3

With maven-3, it uses aether to resolve dependency.

Unfortunately, "mvn dependency:tree" use legacy (maven-2) resolution engine.

How do I find out the true dependency resolution for maven-3. I'm running into an issue where "exec:exec" creates different classpath then "dependency:tree".

In maven 3 - compatibility notes, it says I need to use "-X" and look at the log but there is no pointer what to look for.

Also, "assembly:assembly" brings in different 'jar' than when I print out classpath from "exec:exec".

mjlee
  • 3,374
  • 4
  • 27
  • 22

2 Answers2

2

dependency:tree is the correct way to get the project dependencies. Since version 2.5 of the plugin it now resolves the tree using aether.

exec:exec runs the maven exec plugin. The classpath it generates is based on the plugin dependencies, if specified. It is relevant only for the purpose of the plugin execution and not to be taken in the context of project.

The similar explanation holds good in case of assembly:assembly. The jars that it brings in entirely depends on the plugin and assembly-descriptor configuration.

Stephen Connolly
  • 13,872
  • 6
  • 41
  • 63
Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • Unfortunately, I cannot post pom.xml. But if you follow the link in to "compatibility notes", you will see that they are different. I need to know what is easy way to see dependency resolution. – mjlee Sep 15 '11 at 13:01
1

Since version 2.5 of the Maven Dependency Plugin, dependency:tree works with Maven 3 (see the bug report, and the release notes)

Daniel
  • 10,115
  • 3
  • 44
  • 62