0

I have a multi-module Maven project. The parent pom contains two modules:

  • moduleA (POM)
  • moduleB (POM)

moduleA.pom contains three modules:

  • moduleC (JAR)
  • moduleD (JAR)
  • moduleE (WAR)

moduleB depends on C, D and E.

mvn clean package -DskipTests and mvn clean install -DskipTests runs fine but when I ran mvn dependency:tree after these commands, I faced version conflict error:

[ERROR] Failed to execute goal on project moduleB: Could not resolve dependencies for project com.org:moduleB:pom:1.0.0-SNAPSHOT: Failed to collect dependencies for com.org:moduleB:pom:1.0.0-SNAPSHOT: Could not resolve version conflict among [com.org:moduleC:jar:1.0.0-SNAPSHOT -> com.org:test:jar:[1.0.0,1.1.0), com.org:moduleD:jar:1.0.0-SNAPSHOT -> com.org:test:jar:[1.0.0,2.0.0), com.org:moduleE:jar:1.0.0-SNAPSHOT -> com.org:test:jar:[1.1.0,2.0.0)] -> [Help 1]

module C, D and E are not under my control to change above versioning.

I tried some solutions as mentioned here without any success:

mvn dependency:tree fails on trivial project

dur
  • 15,689
  • 25
  • 79
  • 125
Piyush
  • 31
  • 3
  • Following links could help - https://www.mojohaus.org/versions-maven-plugin/examples/resolve-ranges.html and https://www.mojohaus.org/versions-maven-plugin/resolve-ranges-mojo.html – Anshul Singhal May 30 '19 at 04:15
  • You could also try referring this link: https://stackoverflow.com/questions/28835418/mvn-dependencytree-fails-on-trivial-project – Anshul Singhal May 30 '19 at 05:37

0 Answers0