ferstl / depgraph-maven-plugin

A Maven plugin that generates dependency graphs in various formats (DOT, GML, PlantUML, JSON and Text)
Apache License 2.0
552 stars 84 forks source link

depgraph:graph throws StackOverflowError on parsing transitive dependencies #131

Closed Eskibear closed 2 years ago

Eskibear commented 2 years ago

For transitive dependencies, it goes into infinite loop and throws StackOverflowError exception. While dependencies:tree works well.

The command executed was:

mvn -N com.github.ferstl:depgraph-maven-plugin:graph -DgraphFormat=text -DshowDuplicates -DshowConflicts -DshowVersions -DshowGroupIds -DoutputDirectory=... -DoutputFileName=...

See https://github.com/microsoft/vscode-maven/issues/763#issuecomment-985572321

ferstl commented 2 years ago

Thanks for the investigation. I could reproduce the problem with a simple dependency to arquillian-chameleon-junit-container-starter and setting -DshowConflicts. As a workaround you could remove -DshowConflicts or set its value to false. This will show the same output as mvn dependency:tree, which does not show conflicting dependencies at all.

ferstl commented 2 years ago

The reason for the stack overflow is the conflicting dependency rg.jboss.shrinkwrap.resolver:shrinkwrap-resolver-depchain which forms a circle in the graph:

com.github.ferstl:issue-131:1.0.0-SNAPSHOT:compile
\- org.arquillian.container:arquillian-chameleon-junit-container-starter:1.0.0.CR6:compile
   +- org.jboss.arquillian.junit:arquillian-junit-container:1.4.1.Final:compile
   |  +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-depchain:3.0.1:compile
   |  |  \- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven-embedded:3.0.1:runtime
   |  |     +- org.arquillian.spacelift:arquillian-spacelift:1.0.0.Alpha9:compile (omitted for conflict: 1.0.2)
   |  |     |  +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-depchain:3.0.1:compile (omitted for conflict: 2.1.0)
ferstl commented 2 years ago

I released version 3.3.1 of the plugin which fixes this issue. It should be available on Maven Central within the next few hours.