Blog of Sebastian Häni

Maven Dependency Tree

March 21, 2023 | Maven, Dependency | ...

Ever wanted to understand the dependency graph in a Maven project with sub-modules?

  1. Add the following to the parent pom.xml:
<project>
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.ferstl</groupId>
        <artifactId>depgraph-maven-plugin</artifactId>
        <version>4.0.3</version>
      </plugin>
    </plugins>
  </build>
</project>
  1. Run mvn depgraph:aggregate -DcreateImage=true [-Dincludes=groupId:artifactId]
  2. The graph can be found at target/dependency-graph.png

Documentation: https://github.com/ferstl/depgraph-maven-plugin

Example

Example

(Click to enlarge)


Sebastian Häni

Written by Sebastian Häni who lives, studies and works in Zurich building useful things. You can find his social links on his personal website.

© 2024 Sebastian Häni