如何更改Spring Boot依赖默认版本?例如,Spring Boot1.4使用的是Thymeleaf 2.1版本,但最近的Thymeleaf版本是3.0。那么如何将2.1版改为3.0版呢?
发布于 2016-09-21 18:38:19
文档describes how to do this。
根据问题上的标签判断,您使用的是Maven。您应该向应用程序的pom.xml添加一个属性来设置Thymeleaf版本:
<properties>
<thymeleaf.version>3.0.1.RELEASE</thymeleaf.version>
</properties>还有一个sample application,它展示了如何在Spring Boot1.4中使用Thymeleaf3.0,这可能会很有趣。
发布于 2017-10-28 07:26:19
安迪提供的答案只有当你的POM继承自spring-boot-dependencies时才有效。当通过dependencyManagement添加spring-boot-dependencies时,您必须重新定义要覆盖的所有工件。真扫兴!
Andy引用的文档中也说明了这一点(它可能是后来添加的)。
https://stackoverflow.com/questions/39613498
复制相似问题