yDoc ant target and maven plugin config

yDoc (http://www.yworks.com/en/products_ydoc.htm) is a JavaDoc doclet that adds wonderful, clickable UML diagrams to your JavaDoc.

I have been pestering these guys for a few years for an open source license which they gave me today.

As part payback I thought I would document my configuration of yDoc in my javadoc ant target and my maven pom.xml plugin config. The yDoc guys do not provide either and it can be fiddly to get going.

Ant Target

<!– Produce the javadocs. Includes the JDK1.5 version of yDoc. There is also a 1.4 version but it is different. –>
<target
name=”javadoc”
description=”Creates the javadocs”>

<mkdir dir=”${build.javadoc.dir}”/>
<javadoc
sourcepath=”${src.java.dir}”
destdir=”${build.javadoc.dir}”
packagenames=”net.sf.*”
Package=”true”
overview=”${src.java.dir}/net/sf/ehcache/overview.html”
author=”true”
version=”true”
use=”true”
windowtitle=”${name}”>
<doclet name=”ydoc.doclets.YStandard”
path=”tools/ydoc-2.2_02-jdk1.5/lib/ydoc.jar:tools/ydoc-2.2_02-jdk1.5/resources:tools/ydoc-2.2_02-jdk1.5/lib/class2svg.jar:${build.classes.dir}”
pathref=”project.class.path”>
<param name=”-umlautogen” />
</doclet>

<tag name=”noinspection” description=”IntelliJ Inspection Ignore tag” enabled=”false”/>
<classpath refid=”project.class.path”/>
<header><![CDATA[<a href=”/” target=”_top”>${name}</a>]]></header>
</javadoc>
</target>

Maven reporting plugin config

<!– javadoc –>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<author>true</author>
<bottom>true</bottom>
<destDir>target/site/javadoc</destDir>
<header><![CDATA[<a href=”/” target=”_top”>ehcache</a>]]></header>
<minmemory>128m</minmemory>
<maxmemory>512</maxmemory>
<overview>${basedir}/src/main/java/net/sf/ehcache/overview.html</overview>
<packagenames>net.sf.*</packagenames>
<use>true</use>
<version>true</version>
<windowtitle>${project.name} ${project.version} API</windowtitle>
<doclet>ydoc.doclets.YStandard</doclet>
<docletPath>${basedir}/tools/ydoc-2.2_02-jdk1.5/lib/ydoc.jar:${basedir}/tools/ydoc-2.2_02-jdk1.5/lib/class2svg.jar:${basedir}/tools/ydoc-2.2_02-jdk1.5/resources:${build.classes.dir}</docletPath>
<!–<docletpathref>project.class.path</docletpathref>–>
<additionalparam>-umlautogen</additionalparam>
<tag name=”noinspection” description=”IntelliJ Inspection Ignore tag” enabled=”false”/>
</configuration>
</plugin>

You can see the results of this configuration in ehcache’s online JavaDoc.

Published
Categorized as Java

By Greg Luck

As Terracotta’s CTO, Greg (@gregrluck) is entrusted with understanding market and technology forces and the business drivers that impact Terracotta’s product innovation and customer success. He helps shape company and technology strategy and designs many of the features in Terracotta’s products. Greg came to Terracotta on the acquisition of the popular caching project Ehcache which he founded in 2003. Prior to joining Terracotta, Greg served as Chief Architect at Australian online travel giant Wotif.com. He also served as a lead consultant for ThoughtWorks on accounts in the United States and Australia, was CIO at Virgin Blue, Tempo Services, Stamford Hotels and Resorts and Australian Resorts and spent seven years as a Chartered Accountant in KPMG’s small business and insolvency divisions. He is a regular speaker at conferences and contributor of articles to the technical press.