As described here it is possible to display the dependency-output in graphml format with the following command:
dependency:tree -DoutputType=graphml -DoutputFile=dependencygraphml
But, no mater what value I enter for outputType
the output in file does not change. Maven says they support "text, dot, graphml and tgf" here. Currently I have no idea what I am doing wrong.
By the way I am working with maven 3.0.0 . Any ideas what I could check?
Hence, in your case, maven-dependency-plugin ( + symbol) has as transitive dependencies maven-reporting-impl and doxia-site-renderer at first level, then maven-reporting-impl only has ( - symbol) commons-validator as direct transitive dependency and so on. Follow this answer to receive notifications.
Multiple transitive dependencies can be excluded by using the <exclusion> tag for each of the dependency you want to exclude and placing all these exclusion tags inside the <exclusions> tag in pom. xml. You will need to mention the group id and artifact id of the dependency you wish to exclude in the exclusion tag.
How to get the Maven Dependency Tree of a Project. We can run mvn dependency:tree command in the terminal to print the project dependency tree. For our example, I will be using the Mockito Tutorial project. You can download the project from the GitHub repository.
Transitive Dependencies. Maven avoids the need to discover and specify the libraries that your own dependencies require by including transitive dependencies automatically. This feature is facilitated by reading the project files of your dependencies from the remote repositories specified.
As you posted in the comments here and at dzone, one has to specify a recent enough version of the plugin. Otherwise an old version might get used, which doesn't support graphml yet.
This can be done like this:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:tree -DoutputFile=deps.graphml -DoutputType=graphml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With