Resolving dependency conflicts with different group identifiers?

Conflicting Content Artifacts:

org.javassist:javassist:jar:3.17.1-GA && javassist:javassist:jar:3.12.1.GA

The first comes from Hibernate, and the second from Guava. Both end in the last file of the war. The problem is that classic conflict resolution mechanisms fail because the group id is different. Thus, both jars fall into the final project.

I can't just rule out a Guava dependency in managed dependencies because the project is a multi-module. Some modules use Guava without sleep mode. They would have missed their Javassian addiction. But if I do not make the "extra" artifact, it will appear in the project war file.

Is there a way to tell Maven that these two dependencies are actually two different versions of the same code?

+4
source share
1 answer

I would stick with the following solution:

  • Add an explicit dependency on the javassist artifact in the main pom.xml of your project (so that all child modules inherit this dependency).
  • Exclude javassist from both Hibernate and Guava.
  • Most importantly: add a comment indicating why you need a javassist dependency :)
+3
source

All Articles