How to change Spring Boot dependencies default versions? For example Spring Boot 1.4 uses Thymeleaf 2.1 version but recent version of Thymeleaf is 3.0. So how to change version 2.1 to 3.0?
Overriding Solved Dependency Versions By taking advantage of Maven's nearest definition logic, developers can override the version of a dependency by declaring it on the root pom. xml file. The example below shows an overridden version for checker-qual and how it was managed by Maven.
Adding jackson-bom. version to your properties section of the pom. xml file should update jackson dependencies. This will override jackson version in the Spring Boot Parent POM.
Multiple transitive dependencies can be excluded by using the <exclusion> tag for each of the dependency you want to exclude and placing all these exclusion tags inside the <exclusions> tag in pom. xml. You will need to mention the group id and artifact id of the dependency you wish to exclude in the exclusion tag.
Spring Boot Starter Parent defines spring-boot-dependencies as a parent pom. It inherits dependency management from spring-boot-dependencies. The properties section defines the application default values. The default Java version is 1.8.
The documentation describes how to do this.
Judging by the tags on the question, you're using Maven. You should add a property to your application's pom.xml to set the Thymeleaf version:
<properties>
<thymeleaf.version>3.0.1.RELEASE</thymeleaf.version>
</properties>
There's also a sample application that shows how to use Thymeleaf 3.0 with Spring Boot 1.4 that may be of interest.
The answer provided by Andy only works when your POM inherits from spring-boot-dependencies
. When spring-boot-dependencies
is added through dependencyManagement
, you have to redefine all the artifacts that you want to override. Bummer!
This is also stated in the document referenced by Andy (it might have been added later).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With