赞
踩
安装:yum install nginx
开启服务:service nginx start
重启服务:service nginx restart
打包命令:ng build --prod
<build> <finalName>SpringbootMybatis</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <archive> <manifest> <mainClass> edu.ynmd.cms.Main <!-- 注意:这里的edu.ynmd.cms是项目的包名,Main是启动类的名字 --> </mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </execution> </executions> </plugin> </plugins> </build>
mvn clean package
项目下会有一个dist文件,复制jar包
后台不挂断运行:
nohup java -jar SpringbootMybatis-jar-with-dependencies.jar --server.port=6060 >temp.txt &
注意:端口号需要和前端数据接口对应
强制关闭端口:
lsof -i :6060|grep -v "PID"|awk '{print "kill -9",$2}'|sh