注意 配置文件是:

对比 spring-web 与 spring-boot-starter-web的区别

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>

替换为

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

结果:不配置spring-boot-starter-web 无法启动Tomcat