I'm having difficulty understanding why performing a dependency:tree on an ear, 
will give me transitive dependencies for a dependent artifact with packaging 
type jar, but not of type war.  Here is the sample output from a project 
(strictly for demo purposes):

emiles-macbook:myapp emiles$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] My Application
[INFO] mywebapp
[INFO] myapplib
[INFO] myear
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building My Application 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ myapp ---
[INFO] com.captechventures.sandbox:myapp:pom:0.0.1-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mywebapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ mywebapp ---
[INFO] com.captechventures.sandbox:mywebapp:war:0.0.1-SNAPSHOT
[INFO] \- com.captechventures.sandbox:mysharedlib:jar:wlssl:1.0.0:compile
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myapplib 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ myapplib ---
[INFO] com.captechventures.sandbox:myapplib:jar:0.0.1-SNAPSHOT
[INFO] \- commons-lang:commons-lang:jar:2.1:compile
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myear 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ myear ---
[INFO] com.captechventures.sandbox:myear:ear:0.0.1-SNAPSHOT
[INFO] +- com.captechventures.sandbox:mywebapp:war:0.0.1-SNAPSHOT:compile
[INFO] \- com.captechventures.sandbox:myapplib:jar:0.0.1-SNAPSHOT:compile
[INFO]    \- commons-lang:commons-lang:jar:2.1:compile
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] My Application .................................... SUCCESS [1.445s]
[INFO] mywebapp .......................................... SUCCESS [0.138s]
[INFO] myapplib .......................................... SUCCESS [0.028s]
[INFO] myear ............................................. SUCCESS [0.103s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.421s
[INFO] Finished at: Mon Apr 11 10:27:27 EDT 2011
[INFO] Final Memory: 5M/81M
[INFO] ------------------------------------------------------------------------



You'll notice during the ear build, the transitive dependencies for the jar 
file are shown (and can be navigated programmatically), however the war's 
dependencies are not included at the ear level.  This is problematic as I am 
writing a plugin that will navigate the entire dependency tree for the ear 
(should include transitive dependencies as well) and perform a business 
function.  This is not working as expected as we get no dependencies of the war 
in the DependencyTreeBuilder.

Thoughts?  Hints?  Suggestions?

Thanks in advance.
Eric Miles
Manager / Architect  | CapTech
emi...@captechconsulting.com<emi...@captechventures.com>






Reply via email to