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

Empty Graph because of an circular dependency? #154

Open Gerrri opened 2 years ago

Gerrri commented 2 years ago

We found out that the dependency graph is empty (see below) in projects where an circular dependency exists. Is this an known issue or is there any workarround for that, or are we just too stupid to use the tool? 😄

[INFO] --- depgraph-maven-plugin:4.0.1:for-artifact (default-cli) @ standalone-pom ---
[INFO] Dependency graph:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
ferstl commented 2 years ago

Hi, Do you have an example where this problem occurs? Version 3.3.1 fixed a problem with circular dependencies. But these did only occur when the showConflicts flag was enabled.

Gerrri commented 2 years ago

Hi and sorry for the limited information.

We have run this command: mvn com.github.ferstl:depgraph-maven-plugin:3.3.0:for-artifact -DgroupId=great.group.id -DartifactId=very-important-project -Dversion=1.0.0 -DgraphFormat=text -DshowGroupIds=true -DshowVersions=true

We could reproduce the Problem in a dummy-project. The empty graph appears, when the project only has one dependency in scope:test and in this dependency there is a circular dependency.

If you need further information, let me know :)

ferstl commented 2 years ago

We could reproduce the Problem in a dummy-project.

That would be nice for debugging. If I understand you correctly, your very-important-project looks something like this:

very-important-project
- some-dependency-in-test-scope
  - very-important-project
    -...

One other question: The very-important-project is an external artifact and you run the for-artifact goal without a maven project, correct? If you want to create graphs within a Maven project, you should use graph or the aggregate-* goals.

Gerrri commented 2 years ago

Yes, its an external artifact and there is no maven project.

The Structure is:

very-important-project
- some-dependency-in-test-scope
  -  antoher-dependeny
    - some-dependency-in-test-scope