我的个人网站 www.ryzeyang.top
内容概览
maven包没下载成功导致的一系列bug。。将maven仓库配置为阿里云官网推荐的
整合 thymleaf 和 spring security 后maven报错。。
报错信息如下:
Cannot resolve org.thymeleaf:thymeleaf:3.0.11.RELEASE
通过idea 自带的maven 插件看到这里面的两个包报错变红
于是我傻傻地把他们exclude
了。。(exclude后使用啥 我真是醉了<@_@>🙃 )
thymleaf里面的两个包
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
<version>3.0.11.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
<version>3.0.4.RELEASE</version>
<scope>compile</scope>
</dependency>
exclude
后项目没有报错,还以为顺利解决了。。但是跑起来就出现下面这个问题了。🙃
Circular view path [home]: would dispatch back to the current handler URL [/home] again. Check your ViewResolver setup!
○| ̄|_
一直以为这个web项目配置有问题。。什么MVC,thymleaf的配置都仔细看了又看。。 ○| ̄|_
后面突然开窍。。想着会不会这个maven有问题呀。。 没见过这个整合要exclude
这些的
看了maven配置好像也没啥问题。。 来官网看下阿里云maven仓库指南
之前的配置如下:
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
修改成官网的配置:
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
执行maven clean
额 maven没报错了 项目也正常跑起来了。 ( ̄▽ ̄)"