Springboot打包war

pom:

1.<packaging>war</packaging>

2.<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency>

Application:

从SpringBootServletInitializer派生

重写configure方法:

return application.sources(xxxApplication.class);

原文地址:https://www.cnblogs.com/punkrocker/p/8656820.html