MAVEN PLUGIN(S) SERIES - Generate a Visual Dependency Tree

Maven Dependency Plugin  


The Maven dependency:tree goal produces a helpful report  of all jars coming from in our projects. The default output is text but, sometimes, we would want something more visual. Here is what we have to do

Generate graphml output

Since the version 2.1 the Dependency plugin supports different output formats, one of them the GraphML, which is an XML-based file format for graphs.
To achieve this is very simple it is enough .. cd in your project and run:

> mvn dependency:tree -DoutputType=graphml -DoutputFile=dependency.graphml

yEd a GraphML tool

In order to visualize GraphML, it is possible to use  yEd Graph Editor which is a cool free visualization tool written in Java.

To visualize your dependency tree using yEd, follow the steps outlined below

  1. Open yEd  (It's also possible launch it using java web start)
  2. Select: Open Document > dependency.graphml > OK.
  3. Select: Layout > Hierarchical > Orientation > Left to Right > OK (this should adjust layout)
  4. Select :Tools > Fit Note to Label … > OK.  (This should adjust the labels)
Now, open yED and selectOpen Document -> dependency.graphml > OK.



Popular posts from this blog

PlantUML & Maven - Enrich your project's documentation

PlantText: The new "Online" UML Editor powered by PlantUML

Typescript on JVM passing by Nashorn