Web Starter 作为传递依赖
问题:
工程用的模板是thymeleaf,启动报错提示找不到spring-boot-starter-web
原因:
以前有几个 Spring Boot starter 是依赖于 Spring MVC 而传递的spring-boot-starter-web。在 Spring WebFlux 新的支持下,spring-boot-starter-mustache,spring-boot-starter-freemarker并spring-boot-starter-thymeleaf不再依赖它。开发者有责任选择和添加spring-boot-starter-web或spring-boot-starter-webflux。
解决方案:
导入spring-boot-starter-web既可
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
网友评论