报错原因:
版本问题
当直接引入如下依赖的时候,②处的版本号默认为①处。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
检查maven仓库,可以看到里面只有一个文件。
将他删掉 重新导入,或者选择其他版本号。
解决方法如下:
<!-- 引入thymeleaf的依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>2.0.2.RELEASE</version>
</dependency>