Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble changing outputFormat in mvn dependency:tree

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?

like image 629
EhmKah a.k.a. Michael Krauße Avatar asked Feb 14 '12 16:02

EhmKah a.k.a. Michael Krauße


People also ask

What does /- means in Maven dependency tree?

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.

How do I exclude a specific version of a dependency in Maven?

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 do I find my mvn dependency tree?

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.

How does Maven resolve transitive dependencies?

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.


1 Answers

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
like image 137
Jens Schauder Avatar answered Oct 22 '22 16:10

Jens Schauder