1.
<packaging>war</packaging>
2.
<!--war包修改2 移除嵌入式tomcat插件 --> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion>
3.
SpringBoot启动项
把
@SpringBootApplication public class SpringbootDemoApplication { public static void main(String[] args) { System.setProperty("es.set.netty.runtime.available.processors", "true"); SpringApplication.run(SpringbootDemoApplication.class, args); } }
换成
@SpringBootApplication public class SpringbootDemoApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(SpringbootDemoApplication.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(SpringbootDemoApplication.class); } }