1.pom文件修改
1)jar包 <groupId>cn.bit</groupId> <artifactId>water</artifactId> <version>0.0.1-SNAPSHOT</version>
2)webapp包含进去
<resources>
<resource>
<directory>/Download/projectionname/src/main/webapp</directory>
<!--注意此次必须要放在此目录下才能被访问到-->
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>/Download/projectionname/src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
注意:/Download/projectionname/ 是项目在服务器上的路径名,这里是写死了
2.服务器上
1)进入pom.xml所在路径
2)mvn install
3)java -jar target/online.jar
nohup java -jar online-1.0.0-SNAPSHOT.jar & (后台运行)
后期这块可以修改成启动脚本、关闭脚本
参考文档:
1.https://www.cnblogs.com/javazxy/p/12088121.html
2.https://blog.csdn.net/qq_33378853/article/details/88733165