pom packaging 改成 war spring-boot-starter-tomcat javax.servlet-api scope 设置为 provider ,打包时排除该依赖实现SpringBootServletInitializer,重写configure()方法 mvn clean package tomcat配置 应用目录或war包路径 server.xml host下 org.springframework.boot spring-boot-starter-tomcat provided javax.servlet javax.servlet-api 3.0.1 provided