Generating UML Diagramns with Maven
- Install Graphviz. After installation confirm that it is part of your PATH.
- Configure your maven pom files to make sure that you can get to the following repository: http://mirrors.ibiblio.org/pub/mirrors/maven2 because it has the second piece of the puzzle, the binaries for UMLGraph. You can see all the options for use in <additionalparam/> here.
- To generate UML diagrams as part of the "mvn javadoc:javadoc" command, add the following (+/-) to your pom.xml file's <build/> section.
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<configuration>
<links>
<link>http://java.sun.com/javase/6/docs/api/</link>
</links>
<detectOfflineLinks />
<aggregate>true</aggregate>
<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
<docletArtifact>
<groupId>org.umlgraph</groupId>
<artifactId>doclet</artifactId>
<version>5.1</version>
</docletArtifact>
<additionalparam>-operations</additionalparam>
<additionalparam>-qualify</additionalparam>
<additionalparam>-types</additionalparam>
<additionalparam>-visibility</additionalparam>
<additionalparam>-collpackages</additionalparam>
<additionalparam>-views</additionalparam>
<useStandardDocletOptions>true</useStandardDocletOptions>
<show>private</show>
</configuration>
</plugin>
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.6</version>
<!-- TODO: choose appropriate rulesets -->
<configuration>
<targetJdk>1.6</targetJdk>
</configuration>
</plugin>
</plugins>
</reporting>
5. Run mvn javadoc:aggregate
to generate the Project documentation.
That's it, you should now be reaping the benefits
as your javadocs will have UML diagrams inside each class's landing page.
Refernce: http://wiki.wsmoak.net/cgi-bin/wiki.pl?UMLGraph http://java.dzone.com/articles/reverse-engineer-source-code-u http://brunovernay.blogspot.com/2009/07/umlgraph-and-maven.html
No comments:
Post a Comment