赞
踩
问题描述:
今天搭建了一个SpringBoot项目,但是在启动之后就自行关闭了,就像下面这样:
原因分析:在创建SpringBoot项目的时候,Web的依赖没有导入,默认以普通java项目运行导致的终止。
解决方案:
在pom.xml文件中引入web的jar包,然后刷新maven即可。
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
执行之后,正常启动:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。