1

I am running into this error while trying to compile my maven project during the test execution. From what I understood after insane amount of googling is that this is because of some conflicting version of jackson-core thats in the classpath.

Here is what I find in the dependency hierarchy

enter image description here

I am not sure how to proceed from here, given that only one version appears to be in the effective resolved dependecies

If I skip tests and run the install the build succeeds but fails if I run a test or start a server during run time

If I navigate the repository I see the following versions

2.1.1   2.1.2   2.3.3   2.4.3   2.5.1   2.5.3   2.8.2

Should I delete all of them ?

This is a multimodule project and every moule is bringing some vrsion of this dependency. Does this matter?

1 Answer 1

2

You are bringing in multiple versions of jackson dependencies across all these projects. Jackson isn't designed to be able to mix and match across the versions.

You should should define dependency management at the Parent POM level to manage the jackson artifact versions in use within your own projects.

https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Management

Depending if you have access to these other Jars that are using their own jackson versions you may need to add exclusions to stop maven from using their jackson versions.

https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html

I'd guess the conflict will be between the core and annotation versions in use but realistically you will have issues with the other jackson artifacts being on separate versions like the jaxb-annotations, databind etc.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, after a lot of attempts I was able to fix this by explicitly adding the greatest versions of databind and annotations in the pom.xml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.