2

I'm trying to upgrade my three projects (which inherit from each other A inherits B inherits C) to all contain the exact same versions of poms, as I've found that junit gets confused if different projects use different versions of poms.

I know that if I do a search for a specific jar in the dependency hierachy of a pom file it will show me conflicting versions. However, is there a quick way to get a list of all conflicting versions that I may want to upgrade from eclipse, without checking each jar specifically for a potential conflict?

dsollen
  • 6,046
  • 6
  • 43
  • 84

1 Answers1

4

Have you seen this post recommending the use of section?

Maven dependency resolution (conflicted)

In short you specify the version you want once in a parent/top-level project and then declare the dependency without version in the other projects.

EDIT: Does this blog post help? http://blog.mafr.de/2014/08/30/maven-discovering-dependency-conflicts/

It includes a clever command line invocation that lists dependencies in a project via "mvn dependency" and extracts the lines with conflicts.

mvn dependency:tree -Dverbose | grep --color=always '(.* conflict\|^' | less -r
Community
  • 1
  • 1
Andrew R. Freed
  • 357
  • 1
  • 10
  • hmm, I hadn't realized you could do cross-project dependencies, but I'm still not sure it would work. The reason we have differnt projects is (in theory) we will release some as stand alone frameworks for others to use, so they can't be dependent on our top level. Besides, the problem right now is figuring out where we may have conflicts (particularly not on the top level. Pom A and B each require C. one project has A one has B I don't realize this creates conflicts on C versioning etc). This is still a useful thing to know. – dsollen Oct 28 '15 at 15:12