depgraph-maven-plugin icon indicating copy to clipboard operation
depgraph-maven-plugin copied to clipboard

How to create a multi-module graph?

Open mmoser18 opened this issue 1 year ago • 2 comments

While the description shows nice multi-module graphs also showing the project's modules in my case I only get a parent box pointing to all external libraries. There are none of our own modules shown! They definitely are listed in the main pom under , though!

How do I trigger this plugin to recurse through all our modules and include these in the graph? I would have expected that this is the default for multi-module projects, since there is no recurse options (or similar) mentioned.

And how can I trigger that it includes/shows ONLY our own modules - since I am mainly interested in the module relations (and possible circular references) of our own modules?

mmoser18 avatar Aug 23 '22 09:08 mmoser18

After I defined an output directory I noticed that the plugin generates a graphic (in my case a .puml-file) in a subdirectory in each sub-module. So it apparently does recurse through all modules and generates "local" graphs. These graphs also show other modules (if referenced). Maybe it created but then overwrote these local graphs with the parent graph when I did not specify a directory name? Whatever - I am now redirecting all files into the same directory and give them different names.

Meanwhile I also solved my issue re. filtering. it's apparently the group-id that is filtered on. For some reason I had initially assumed it was the artifactId.

So - the only issue remaining is whether (and if so: how) one can combine all modules into a single graph.

mmoser18 avatar Aug 23 '22 10:08 mmoser18

Hi @mmoser18 Based on your description of your problem, it seems that you are using the depgraph:graph goal of the plugin. When run on a multi-module project it will create a graph for each module in the module's target directory. If you configure another directory using the outputDirectory option you will have the situation that the files are overwritten and the last one will remain in the folder. You can solve this by setting useArtifactIdInFileName to true.

If you want to create a single graph for a multi-module project you should use the depgraph:aggregate goal.

I hope that helps.

Cheers, Stefan

ferstl avatar Sep 28 '22 20:09 ferstl