Is there any alternative for anotations and comments in UMLGraph

481 Views Asked by At

I am using UMLGraph for Java to UML. It says the following in documentation for relationships:

association relationships (specified using the javadoc @assoc tag)

navigatable (directed) association relationships (specified using the javadoc @navassoc tag)

aggregation relationships (specified using the javadoc @has tag)

composition relationships (specified using the javadoc @composed tag)

dependency relationships (specified using the javadoc @depend tag)

i cannot add these tags or any comments in the source. Is there any alternative for this

2

There are 2 best solutions below

1
On BEST ANSWER

If you're using the commonly available template for configuring UmlGraph, then you're probably using an old version.

I can't find the doclet in the usual maven repositories. I suggest you download the latest version and just deploy it manually to your repository manager. You can download it from here: http://www.umlgraph.org/download.html

Once you've deployed it, use this:

  <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-javadoc-plugin</artifactId>
   <version>2.9</version>
   <configuration>
    <maxmemory>1024</maxmemory>
    <quiet>true</quiet>
    <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
    <docletArtifact>
     <groupId>org.umlgraph</groupId>
     <artifactId>doclet</artifactId>
     <version>5.6</version>
    </docletArtifact>
    <additionalparam>
     -inferrel -inferdep -quiet -hide java.*
     -collpackages java.util.* -qualify -postfixpackage
     -nodefontsize 9 -nodefontpackagesize 7
    </additionalparam>
    <links>
     <link>http://download.oracle.com/javase/7/docs/api</link>
    </links>
   </configuration>
  </plugin>
3
On

In you are using Java 8 and UMLGraph in its latest snapshots version compatible with Java 8, requires extra configuration due to changes in Javadoc doclint‌​. So this case it requires extra parameters: See belove.

 <!-- UMLGraph Javadoc doclet -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<configuration>
<tags>
<tag>
<name>depend</name>
<placement>X</placement>
</tag>
<tag>
<name>hidden</name>
<placement>X</placement>
</tag>
<tag>
<name>opt</name>
<placement>X</placement>
</tag>
<tag>
<name>assoc</name>
<placement>X</placement>
</tag>
<tag>
<name>has</name>
<placement>X</placement>
</tag>
<tag>
<name>composed</name>
<placement>X</placement>
</tag>
<tag>
<name>view</name>
<placement>X</placement>
</tag>
<tag>
<name>match</name>
<placement>X</placement>
</tag>
</tags>
<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
<docletPath>${basedir}/doclets/UmlGraph.jar</docletPath>
<additionalparam>-inferrel</additionalparam>
<additionalparam>-inferdep</additionalparam>
<additionalparam>-collapsible</additionalparam>
<additionalparam>-hide java.*</additionalparam>
<additionalparam>-compact</additionalparam>
<additionalparam>-subpackages gr.spinellis</additionalparam>
<useStandardDocletOptions>true</useStandardDocletOptions>
</configuration>
</plugin>