【thymeleaf版本】Failure to find org.thymeleaf:thymeleaf-spring5:jar:2 .1.1.RELEASE

背景

搭建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有冲突,导致包获取不正确

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章