jakub holý

building the right thing, building it right, fast

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

2012-01-13 13:06:57Tools

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.