Configuring Custom Javadoc Tags

To configure any custom tags, use <tags/> parameter as shown below. Each tag will be consist of a <name/>, a <placement/> and a <head/>. The <placement/> should be a combination of the letters Xaoptcmf:

  • X (disable tag)
  • a (all)
  • o (overview)
  • p (packages)
  • t (types, that is classes and interfaces)
  • c (constructors)
  • m (methods)
  • f (fields)

For instance, with the following configuration:

  1. <project>
  2. ...
  3. <reporting> (or <build>)
  4. <plugins>
  5. <plugin>
  6. <groupId>org.apache.maven.plugins</groupId>
  7. <artifactId>maven-javadoc-plugin</artifactId>
  8. <version>2.10.4</version>
  9. <configuration>
  10. ...
  11. <tags>
  12. <tag>
  13. <name>todo</name>
  14. <!-- todo tag for all places -->
  15. <placement>a</placement>
  16. <head>To do something:</head>
  17. </tag>
  18. </tags>
  19. ...
  20. </configuration>
  21. </plugin>
  22. </plugins>
  23. ...
  24. </reporting> (or </build>)
  25. ...
  26. </project>

and with the following todo tag in a class:

  1. /**
  2. * Hello world!
  3. *
  4. * @todo complete me!
  5. */
  6. public class App {}

the Javadoc tool will generate the following Javadoc:

  1. public class App
  2. extends Object
  3.  
  4. Hello world!
  5.  
  6. To do something:
  7. complete me!