Resolving Maven dependencies with dependency:tree 

Joined:
08/13/2009
Posts:
172

March 22, 2010 03:56:32    Last update: March 22, 2010 03:56:32
The Maven dependency:tree goal displays the dependency tree for the current project:
C:\Users\fang\work\maven\javaee-app>mvn dependency:tree
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   Java EE pom
[INFO]   Java EE ejb
[INFO]   Java EE webapp
[INFO]   Java EE ear
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Java EE pom
[INFO]    task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
[INFO] [dependency:tree {execution: default-cli}]
[INFO] maven-tutorial:java-ee:pom:1.0
[INFO] \- javax:javaee-api:jar:6.0-SNAPSHOT:provided
[INFO] ------------------------------------------------------------------------
[INFO] Building Java EE ejb
[INFO]    task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
[INFO] [dependency:tree {execution: default-cli}]
[INFO] maven-tutorial.java-ee:ejb:ejb:1.0
[INFO] \- javax:javaee-api:jar:6.0-SNAPSHOT:provided
[INFO] ------------------------------------------------------------------------
[INFO] Building Java EE webapp
[INFO]    task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
[INFO] [dependency:tree {execution: default-cli}]
[INFO] maven-tutorial.java-ee:webapp:war:1.0
[INFO] +- maven-tutorial.java-ee:ejb:ejb-client:client:1.0:provided
[INFO] +- struts:struts:jar:1.2.9:compile
[INFO] |  +- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] |  +- commons-digester:commons-digester:jar:1.6:compile
[INFO] |  |  +- commons-collections:commons-collections:jar:2.1:compile
[INFO] |  |  \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] |  +- commons-fileupload:commons-fileupload:jar:1.0:compile
[INFO] |  +- commons-logging:commons-logging:jar:1.0.4:compile
[INFO] |  +- commons-validator:commons-validator:jar:1.1.4:compile
[INFO] |  +- oro:oro:jar:2.0.7:compile
[INFO] |  +- antlr:antlr:jar:2.7.2:compile
[INFO] |  \- xalan:xalan:jar:2.5.1:compile
[INFO] \- javax:javaee-api:jar:6.0-SNAPSHOT:provided
[INFO] ------------------------------------------------------------------------
[INFO] Building Java EE ear
[INFO]    task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
[INFO] [dependency:tree {execution: default-cli}]
[INFO] maven-tutorial.java-ee:ear:ear:1.0
[INFO] +- maven-tutorial.java-ee:webapp:war:1.0:compile
[INFO] +- maven-tutorial.java-ee:ejb:ejb:1.0:compile
[INFO] \- javax:javaee-api:jar:6.0-SNAPSHOT:provided
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] Java EE pom ........................................... SUCCESS [4.148s]
[INFO] Java EE ejb ........................................... SUCCESS [0.008s]
[INFO] Java EE webapp ........................................ SUCCESS [0.072s]
[INFO] Java EE ear ........................................... SUCCESS [0.010s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 seconds
[INFO] Finished at: Sun Mar 21 22:26:48 CDT 2010
[INFO] Final Memory: 10M/18M
[INFO] ------------------------------------------------------------------------


Maven may complain that it cannot resolve artifacts in your current project. Just run mvn install to install the artifacts to the local repository.
Share |
| Comment  | Tags