Geertjan's Blog

  • September 1, 2008

Generate UML Diagrams into Javadoc for NetBeans Module Projects

Geertjan Wielenga
Product Manager
Here's Javadoc with UML diagrams for the Google Toolbar module from the NetBeans Plugin Quick Start:

To let the IDE automatically generate UML diagrams into your NetBeans module's Javadoc, do this:

  1. Read this for background and to set up the required software.

  2. Add this to the module project's build.xml file:
    <target name="netbeans-extra" description="Generates UML-Javadoc">
    <property file="nbproject/project.properties"/>
    <mkdir dir="${dist.javadoc.dir}"/>
    <javadoc source="${javac.source}" packagenames="org.\*"
    <path path="${javac.classpath}"/>
    <path path="${module.classpath}"/>
    <fileset dir="${src.dir}" excludes="${excludes}"
    <filename name="\*\*/\*.java"/>
    <doclet name="org.umlgraph.doclet.UmlGraphDoc"
    <param name="-attributes" />
    <param name="-operations" />
    <param name="-qualify" />
    <param name="-types" />
    <param name="-visibility" />

  3. Put UmlGraph.jar in release/modules/ext (or anywhere else, as long as the reference in project.properties for ${file.reference.UmlGraph.jar} is correct).

  4. Copy the content of a standard NetBeans Java project's project.properties file into your module project's project.properties file.

Now build the module and then look in the Files window, within dist/javadoc and you should find your HTML files have UML diagrams.

Join the discussion

Comments ( 1 )
  • Javier Ortiz Friday, July 23, 2010

    It works great if the module is stand alone. If not it complains about classes not found (from the other modules). Any idea how to fix this?

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.