Custom Doclet from Google

Doclava is custom Javadoc Doclet from Google, used by Google Guice (see their slight cooler Javadocs). Doclava uses JSilver as its templating engine, a pure-Java implementation of Clearsilver. I personally like the idea of Federated Documents to allow documentations to link and intgrate to each other on open projects. Here are the main differences between Doclava and the standard Doclet:

  • Refreshed look and feel, including search capabilities.
  • Embeds versioning information in the documentation.
  • Uses a templating engine for user customizations.
  • Throw build errors for things that can easily be caught, like @param tags that don’t match the parameter names.
  • Ability to include snippets of code from real source code
  • Federate documentation between multiple sites.
  • Ability to embed javadocs in a larger web page.

Using Doclava with Javadoc

  -doclet -docletpath ${jar.file}

Using Doclava with Ant


Using Doclava with Maven

  ...             ...               org.apache.maven.plugins         maven-javadoc-plugin         2.7                                  doclava             1.0.3                                ${sun.boot.class.path}                        -quiet              -federate JDK              -federationxml JDK              -hdf "${}"              -d ${}/apidocs                       false                     -J-Xmx1024m                    

Improved Tags

Doclava supports a few extra tags such as @undeprecate (pretty self-explanatory), @hide (remove from the documentation), @include $filePath (includes text from file), @sample (includes sample from file) and a few different ones. Please see the complete list here.


And if you are tired of the old Javadoc look and feel, you can customize the output of Doclava. For more information click here.

[![Enhanced by Zemanta](]( "Enhanced by Zemanta")