Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for a way to visualize dependency structure of my multi-module pom project

I have a pretty large project (~30 modules) and want to visualize module inter dependencies, excluding 3rd party.

It seems that existing tools simply can't handle the maven reactor. The maven dependency plugin (dependency:tree goal) knows how to generate graphml, but only per module. And if I use the append flag, it simply shoves everything to a single file, so the output is a corrupted graphml.

I also found this tool but it seems that there is no way to control module granularity.

My last resort would be to parse the output of dependency:tree, but I thought I'll consult the community before this.

like image 615
Vitaliy Avatar asked Oct 30 '25 18:10

Vitaliy


1 Answers

I like depgraph-maven-plugin to visualize dependencies in a multi-module project. To get an aggregated result in text format (like dependency:tree) for your modules, use:

mvn com.github.ferstl:depgraph-maven-plugin:aggregate -DgraphFormat=text -Dincludes=myGroupId

The syntax for includes is the same as with maven-dependency-plugin includes.

It has a lot of properties to customize the result/behavior. I prefer to use it together with graphviz, so I can use the (default) graph format dot and let it create a png file in the target folder:

mvn com.github.ferstl:depgraph-maven-plugin:aggregate -DcreateImage -Dincludes=myGroupId

There are also other interesting goals, e.g. an example goal to quickly play around with the properties.

like image 169
msa Avatar answered Nov 02 '25 08:11

msa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!