1

Is there a generally-accepted notation to allow a representation of dependencies, inheritance and module aggregation for Maven Projects?

I haven't spent a lot of time looking, but nothing had immediately jumped out at me.

I've seen with the notation used in Sonatype's Complete Reference (eg. Figure 3.5. Enterprise Multi-module vs. Inheritance), but would prefer something that doesn't rely on colour to convey semantics.

I've been using UML-like syntax which shows a project "aggregating" (diamond symbol) the projects listed in it's <modules> section, UML inheritance for parent-child relationships and a broken-line with arrow to show dependency.

Are there better ideas out there?

Jacob Zwiers
  • 1,092
  • 1
  • 13
  • 33
  • I provided an answer, then noticed that this seems to be an almost exact duplicate of http://stackoverflow.com/questions/5378785/generating-maven-project-inheritance-aggregation-diagram – noahlz Oct 22 '12 at 18:10

1 Answers1

0

For dependency diagrams, the convention is to use the output of dependency:tree

i.e.

[user:maven-test]$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-test 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ maven-test ---
[INFO] maven-test:maven-test:jar:1.0
[INFO] +- junit:junit:jar:3.8.1:test
[INFO] +- com.sun.jersey:jersey-json:jar:1.9.1:compile
[INFO] |  +- org.codehaus.jettison:jettison:jar:1.1:compile
[INFO] |  |  \- stax:stax-api:jar:1.0.1:compile
[INFO] |  +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] |  |  \- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] |  |     +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] |  |     \- javax.activation:activation:jar:1.1:compile
[INFO] |  +- org.codehaus.jackson:jackson-core-asl:jar:1.8.3:compile
[INFO] |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.8.3:compile
[INFO] |  +- org.codehaus.jackson:jackson-jaxrs:jar:1.8.3:compile
[INFO] |  +- org.codehaus.jackson:jackson-xc:jar:1.8.3:compile
[INFO] |  \- com.sun.jersey:jersey-core:jar:1.9.1:compile
[INFO] +- com.sun.jersey:jersey-server:jar:1.14:compile
[INFO] |  \- asm:asm:jar:3.1:compile
[INFO] \- com.sun.jersey:jersey-client:jar:1.14:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

It turns out that this plugin can output to a visual graph.

See: Maven Dependency Plugin - Output type.

If you are using IntelliJ IDEA, it has a built in Maven dependency graph as well.

noahlz
  • 10,202
  • 7
  • 56
  • 75