如下所示,将spring-boot-starter-tomcat依赖中的<scope>provided</scope>注释掉
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <!--<scope>provided</scope>--></dependency>