Thursday, April 20, 2017

Maven Dependency tree with resolution procedure

Maven – Display project dependency


1. mvn dependency:tree
In Maven, you can use mvn dependency:tree to display the project dependencies in tree format.

Resource Link: https://www.mkyong.com/maven/maven-display-project-dependency/

----------------------------------------------------------------------------------------------------------------------
2. You can use the following command to get a list of plugin dependencies (resolve-plugin goal from dependencies plugin):
mvn dependency:tree -Dincludes=org.apache.logging.log4j:log4j-1.2.17
-----------------------------------------------------------------------------------------------------------------------

3.
mvn dependency:resolve-plugins

It resolves all plugin. But there is a issue. resolve-plugins doesn't just output the dependency tree... it seems to re-download all of the packages. Not ideal.

Resource Link: http://stackoverflow.com/a/7079876/4748635

------------------------------------------------------------------------------------------------------------------------
4. Resolving conflicts using the dependency tree

mvn dependency:tree -Dverbose -Dincludes=commons-collections

mvn dependency:tree -Dverbose -Dincludes=log4j

Resource Link: https://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html

No comments:

Post a Comment