新建一个spring boot的web项目,运行之后控制台输出“Unregistering JMX-exposed beans on shutdown”,tomcat也没有运行。寻找原因,看了下pom.xml文件中tomcat依赖关系如下:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency>
将<scope>provided</scope>注释掉,重新运行项目便可启动嵌入的tomcat服务器:Tomcat started on port(s): 8080 (http)