springboot项目因为其有内嵌得tomcat(还包括 jetty等)所以打包得时候要排除内置得tomcat
具体步骤
1.pom.xml文件中添加打包格式:
在project标签下添加
<packaging>war</packaging>
2.排除内置tomcat 或者设置成provider
1>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
2>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <!-- 移除嵌入式tomcat插件 -->
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>