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

Marcel Overdijk picture Marcel Overdijk · Aug 7, 2014 · Viewed 12.2k times · Source

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.

Answer

Phil Webb picture Phil Webb · Aug 7, 2014

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>