1、向需要打包的项目pom文件中导入插件
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.3.3.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
2、将该项目中用到的自己写的项目install
3、将该项目打包
4、在target文件夹中找到打包好的压缩包
5、将压缩包放入虚拟机
- 发布项目:java -jar xxxxxxxxxxxxxxx.jar
- 发布项目并一直在后台运行:nohup java -jar xxxxxxxxxxxxxxx.jar &