spring boot打包

1.application继承SpringBootServletInitializer  重写configure方法如下图

2.去掉项目中多余的main方法

3.将pom.xml打包改为war包

4. 在项目目录下执行   mvn package -Dmaven.test.skip=true 

target目录下就会存在xxx.war包    将其放在tomcat的webapps目录下即可

原文地址:https://www.cnblogs.com/helloDuo/p/9746809.html