Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make sure Spring Boot extra Jackson modules are of same version?

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.

like image 988
Marcel Overdijk Avatar asked Aug 07 '14 14:08

Marcel Overdijk


2 Answers

Spring Boot provides managed dependencies for the following Jackson modules:

  • jackson-annotations
  • jackson-core
  • jackson-databind
  • jackson-datatype-joda
  • jackson-datatype-jsr310

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>
like image 196
Phil Webb Avatar answered Oct 26 '22 23:10

Phil Webb


In Gradle just add ext['jackson.version'] = 'specify version here' before dependencies section.

like image 28
Valeriy K. Avatar answered Oct 27 '22 00:10

Valeriy K.