Reputation: 11467
Spring Boot already contains the core Jackson dependency + several others.
If you e.g. want to add the org.json or jsr-353 databinding modules you to explicitly define the vesion of these additional modules.
Is there a way to refer to the same version of the other Jackson modules? I want to avoid any compatibility issues.
Upvotes: 12
Views: 22384
Reputation: 2906
In Gradle just add ext['jackson.version'] = 'specify version here'
before dependencies section.
Upvotes: 8
Reputation: 18642
Specify your dependencies explicitly and remove dependencies that you don't need as in:
<!-- Add typical dependencies for a web application -->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<artifactId>jackson-databind</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20131018</version>
</dependency>
</dependencies>
You can also change the version of built-in libs by overriding the properties. A list of properties can be found by looking at properties from effective POM using the command below. You can find the property which @Phil Web mentioned in the effective POM.
mvn help:effective-pom
Upvotes: 2
Reputation: 8622
Spring Boot provides managed dependencies for the following Jackson modules:
If you're using maven then additional modules could be defined in your own POM using the ${jackson.version}
property. eg:
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-whatever</artifactId>
<version>${jackson.version}</version>
</dependency>
Upvotes: 16