背景
搭建springboot多模塊時,打包時報如下錯誤
[ERROR] Failed to execute goal on project portal: Could not resolve dependencies for project per.haha:portal:jar:0.0.1-SNAPSHOT:
Failure to find org.thymeleaf:thymeleaf-spring5:jar:2
.1.1.RELEASE in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be
reattempted until the update interval of alimaven has elapsed or updates are forced -> [Help 1]
解決
pom.xml中properties標籤內的thymeleaf標籤名問題
<thymeleaf.version>2.1.1.RELEASE</thymeleaf.version>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>${springboot-thymeleaf.version}</version>
</dependency>
改成
<springboot-thymeleaf.version>2.1.1.RELEASE</springboot-thymeleaf.version>
原因
這裏用的是org.springframework.boot下的spring-boot-starter-thymeleaf,使用<thymeleaf.version>做標籤時可能與org.thymeleaf有衝突,導致包獲取不正確