Visualize Maven Project Dependencies with dependency:tree and Dot Diagram Output

The dependency:tree goal of the Maven plugin dependency supports various graphical outputs from the version 2.4 up. This is how you would create a diagram showing all dependencies in the com.example group in the dot format:

mvn dependency:tree -Dincludes=com.example -DappendOutput=true -DoutputType=dot -DoutputFile=/path/to/output.gv

(The output is just a text file with the extension Graphviz gv.)

To actually produce an image from the dot file you can use one of dot renderers, f.ex. this online dot renderer (paste into the right text box, press enter).

You could also generate the output f.ex. in the graphml format & visualize it in Eclipse.

Note: Thanks to the reader Not Relevant for pointing out the right extension and a typo.

Published by Jakub Holý

I’m a JVM-based developer since 2005, consultant, and occasionally a project manager, working currently with Iterate AS in Norway.

4 thoughts on “Visualize Maven Project Dependencies with dependency:tree and Dot Diagram Output

  1. Hi, I’m very new to maven, so I’m sorry for the stupid question. How I can install dependency-plugin? I’ve tried: mvn org.apache.maven.plugins:maven-dependency-plugin:2.6:resolve-plugins , but build failed on:

    Embedded error: Unable to determine the release version

    Try downloading the file manually from the project website.

    1. Hi Plaz, you should not need to install anything. I believe that Maven should find it itself. (I am using Maven 3, if that makes a difference.)

Comments are closed.