Jackson Dependency Issue in Spring Boot with Maven Build

Jackson Dependency Issue in Spring Boot with Maven Build


Recently while working with Jackson within a Spring Boot project, I encountered an issue I’d like to share with you.

Jackson is currently the leading option for parsing JSON in Java. The Jackson library is composed of three components: Jackson Databind, Core, and Annotation. Jackson Databind has internal dependencies on Jackson Core and Annotation. Therefore, adding Jackson Databind to your Maven POM dependency list will include the other dependencies as well. To use the latest Jackson library, you need to add the following dependency in the Maven POM.

The above dependency works well in other Java projects, but unfortunately in a Spring Boot 1.3.x application, you may stumble upon this error.

Jackson Dependency Conflict Error in Spring Boot

You may see several different errors. Here are some additional examples.

This error occurs due to Jackson dependency conflict. We are working on a Spring Boot project and it’s inheriting from the Spring Boot parent POM that includes Jackson. Without any Jackson dependency in the project POM, let’s print the Maven dependency tree to view the in-built Jackson dependencies.

The output is this.

Spring Framework 5
Check out my online course – Spring Framework 5: Beginner to Guru!

As you can see above, the Spring Boot parent POM uses an older version of Jackson (2.6.5).

Now, if we add the Jackson dependency to our Maven POM using the version like this:

Maven will pulling in older versions of Jackson-annotation and Jackson-core and overriding the newer ones. We can see this by running the dependency:tree command again.

I did not expect Maven to behave this way in dependency resolution. The POM for the primary Jackson artifact does call for the proper version. However, this seems to be getting overridden by the versions specified explicitly in the Spring Boot parent POM.

Ideally, when working with Spring Boot, is to leverage the curated dependencies in the Spring Boot parent POM. In this case, we drop the version for the Jackson dependency so it will get inherited from the Spring Boot Parent POM.

Now, the version will be inherited from the parent POM, and the issue will be resolved.

But what if we want to use a newer version of Jackson? The proper way is to exclude the inherent dependencies, and explicitly add their new versions, like this.

This POM configuration will override the Jackson dependencies set in the Spring Boot parent POM.

This post is specific to Spring Boot version 1.3.3. Naturally, the Spring Boot team will be evolving the version of Jackson used in future releases.

For developers accustomed to working with Maven dependendencies, it’s a very easy mistake to include the version in the dependency declaration. This can cause some unintended issues due to version conflicts. It is a little bit of a paradigm shift for experienced developers to depend on the Spring Boot parent POM. Some won’t want to relinquish control, but in the long run I expect you will be better of leveraging the Spring Boot curated dependencies.

If you’d like to learn more about Jackson and Spring Boot checkout my other posts:


About jt

    You May Also Like

    7 comments on “Jackson Dependency Issue in Spring Boot with Maven Build

    1. July 6, 2016 at 2:22 pm

      Thank you!

    2. September 13, 2016 at 7:19 am


      you can specify a particular version with


      the current available maven configuracion properties are available at https://github.com/spring-projects/spring-boot/blob/master/spring-boot-dependencies/pom.xml

    3. January 9, 2017 at 5:06 pm

      This was really helpful. All the Stackoverflow articles said to make sure the versions for core and annotations were the same and that wasn’t getting me anywhere. I only wish I found your article sooner

    4. April 8, 2017 at 4:41 pm

      Thank you, Was the solution to my problem.

    5. February 8, 2018 at 11:35 am

      This also happens with Spring 1.5.9 … thank you for this article.

    6. April 20, 2018 at 4:20 pm

      And also with Spring Boot 1.5.11… ditto, thank you for the article!

    7. June 15, 2018 at 12:03 am

      Thanx for detailed explanation!!!


    Leave a Reply