- 添加maven插件,指定主类
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.lm.cms2.DemoApplication</mainClass>
</configuration>
</plugin>
</plugins>
- 点击maven projects,再点击install
- 打包成功
复制jar到服务器,java -jar xxx.jar 运行