I try to useUmlGraphDoc, however, every time I run the javadoc command, I get a weird error:
[javadoc] javadoc: warning - Errors running Graphviz on /private/tmp/test/docs/Class1.dot
[javadoc] Building Context view for class Fail
[javadoc] javadoc: warning - Errors running Graphviz on /private/tmp/test/docs/Class2.dot
My code looks like that:
import externalPackage.TestClass;
public abstract class Class1 {
private TestClass myFail;
public boolean doSomething(TestClass fail) {
return true;
}
}
public class Class2 extends Class1 {
@Override
public boolean doSomething(TestClass fail) {
fail.toString();
return false;
}
}
build.xml
<project name="de.matt3o12.test" default="javadocs">
<path id="lib">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</path>
<target name="javadocs">
<javadoc verbose="true" destdir="docs" public="true">
<classpath>
<path refid="lib" />
<path path="${javac.classpath}" />
</classpath>
<fileset dir="src">
<filename name="**/*.java" />
</fileset>
<doclet name="org.umlgraph.doclet.UmlGraphDoc" path="lib/UMLGraph.jar">
<param name="-inferrel"/>
<param name="-inferdep"/>
<param name="-hide" value="java.*"/>
<param name="-collpackages" value="java.util.*"/>
<param name="-qualify"/>
<param name="-postfixpackage"/>
<param name="-nodefontsize" value="9"/>
<param name="-nodefontpackagesize" value="7"/>
<param name="-link" value="http://java.sun.com/j2se/1.5.0/docs/guide/javadoc/doclet/spec"/>
<param name="-link" value="http://java.sun.com/j2se/1.5/docs/api"/>
</doclet>
</javadoc>
</target>
</project>
I'm using Mac OS X Lion and Mavericks. The dot version on my mavericks computer is dot - graphviz version 2.38.0
. It is the newest binary package to download.
Here is zip file containing all classes (and libs) I used to generate this error. When you run the ANT script, an error like the on above will be generated. The docs look fine (even the UML diagrams), however, on my bigger project (where I got the error in the first place), some of the diagrams that generated the errors, don't work
These errors only occur when:
- TestClass is in an external package (a jar containing the class is defined in classpath. javac works perfectly).
doSomething
is overwritten- the private var
myFail
is set.
If the myFail
is removed, or doSomething
isn't overwritten (e.g. it isn't defined in Class1 or Class2), or TestClass is in the same package, no errors will occur.