Latest version available in Central Maven repository is 4.6. This is a pretty old version of UmlGraph that for me throws NullPointerException every time I'm using generics in code.
Solution that I found to be able to generate class diagrams for projects was to migrate to a new version of UmlGraph, version 5.2. UmlGraph vesion 5.2 is the latest available at the moment of writing this blog entry.
However, this latest vesion is not availble in Maven Central repository. The solution is to install it in local repository or organization remote repository.
To install locally, here is the command line:
mvn install:install-file -Dpackaging=jar -DartifactId=UmlGraph -Dversion=5.2 -Dfile=/home/{user}/opt/UmlGraph-5.2.jar -DgroupId=gr.spinellis -DgeneratePom=true
Command assume that you have downloaded the jar from UmlGraph site to /home/{user}/opt folder.
Also UmlGraph code has been re-organized and the doclet is located in org.umlgraph.doclet package. To use it in your project you have to specify the doclet as part of javadoc maven plug-in:
<plug-in>
<artifactid>maven-javadoc-plugin</artifactid>
<configuration>
<source>1.5</source>
<aggregate>true</aggregate>
<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
<docletartifact>
<groupid>gr.spinellis</groupid>
<artifactid>UmlGraph</artifactid>
<version>5.2</version>
</docletartifact>
<additionalparam>
-all -inferrel -inferdep -quiet -hide java.*
-collpackages java.util.* -qualify
-postfixpackage -nodefontsize 9
-nodefontpackagesize 7 -outputencoding utf8
</additionalparam>
</configuration>
</plug-in>
4 comments:
Great, works and solves the NullPointerException problem in javadoc:aggregate goal
Are you using UmlGraph 5.2 with JDK 1.6 and Maven Javadoc Plugin 2.5? I get
... umlgraph javadoc: error - invalid flag: -author
I have used JDK 1.5 and javadoc plug-in 2.5.
Thanks, I already spent a few hours trying to figure out how to use UmlGraph within a maven project, and your post helped me finish that.
Post a Comment