原连接https://www.jianshu.com/p/cc20d6e8f2c4
1、packaging改为war
<packaging>war</packaging>
2、排除spring-boot-starter-web中的Tomcat
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
3、添加tomcat依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
小礼物走一走,来简书关注我
作者:_灯火阑珊处
链接:https://www.jianshu.com/p/cc20d6e8f2c4
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。