3

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.

Vitaliy
  • 8,044
  • 7
  • 38
  • 66
  • Does this answer your question? [How to generate a graph of the dependency between all modules of a Maven project?](https://stackoverflow.com/questions/4084669/how-to-generate-a-graph-of-the-dependency-between-all-modules-of-a-maven-project) – msa Oct 02 '20 at 12:39

2 Answers2

4

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.

msa
  • 702
  • 7
  • 14
-1

i have actually the same situation. we have 4 big projects with ~100 pom.xml per project and dependencies between them. i had not found a good software.

now i use structure 101 (structure101.com) to show me the dependencies between them. sure, it is not maven pom.xml based, but in my case i think the problem because i have this massive count of maven project in every application is the missing software architecture.

currently i try to visualize these dependencies on class/package level and also with a deployment view (https://en.wikipedia.org/wiki/Deployment_diagram)

i hobe this helped you a little bit.

Software i used but no tool was really good for my pom.xml count:

StefanHeimberg
  • 1,455
  • 13
  • 22