Configuring Custom Taglets

You could configure any custom taglets in your Javadoc Plugin configuration via the <taglet/>, <taglets/>, or <tagletArtifacts/> parameters, depending the number of taglets used.

For more information about the taglet technology, please refer to http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/taglet/overview.html.

One Taglet

For one known Taglet, just use the <taglet/> parameter:

  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. <taglet>package.to.YourTagletClass</taglet>
  12. <!-- <tagletpath>/path/to/taglet.jar</tagletpath> -->
  13. <tagletArtifact>
  14. <groupId>group-Taglet</groupId>
  15. <artifactId>artifact-Taglet</artifactId>
  16. <version>version-Taglet</version>
  17. </tagletArtifact>
  18. ...
  19. </configuration>
  20. </plugin>
  21. </plugins>
  22. ...
  23. </reporting> (or </build>)
  24. ...
  25. </project>

Several Taglets

For several known Taglets, just use the <taglets/> parameter:

  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. <taglets>
  12. <taglet>
  13. <tagletClass>package.to.YourFirstTagletClass</tagletClass>
  14. <!-- <tagletpath>/path/to/taglet.jar</tagletpath> -->
  15. <tagletArtifact>
  16. <groupId>group-FirstTaglet</groupId>
  17. <artifactId>artifact-FirstTaglet</artifactId>
  18. <version>version-FirstTaglet</version>
  19. </tagletArtifact>
  20. </taglet>
  21.  
  22. <taglet>
  23. <tagletClass>package.to.YourSecondTagletClass</tagletClass>
  24. <!-- <tagletpath>/path/to/taglet.jar</tagletpath> -->
  25. <tagletArtifact>
  26. <groupId>group-SecondTaglet</groupId>
  27. <artifactId>artifact-SecondTaglet</artifactId>
  28. <version>version-SecondTaglet</version>
  29. </tagletArtifact>
  30. </taglet>
  31. ...
  32. </taglets>
  33. ...
  34. </configuration>
  35. </plugin>
  36. </plugins>
  37. ...
  38. </reporting> (or </build>)
  39. ...
  40. </project>

If it is several Taglets in the same Taglet artifact, you could use the <taglets/> and the <tagletArtifact/> parameters:

  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. <taglets>
  12. <taglet>
  13. <tagletClass>package.to.YourFirstTagletClass</tagletClass>
  14. </taglet>
  15.  
  16. <taglet>
  17. <tagletClass>package.to.YourSecondTagletClass</tagletClass>
  18. </taglet>
  19. ...
  20. </taglets>
  21.  
  22. <tagletArtifact>
  23. <groupId>group-Taglet</groupId>
  24. <artifactId>artifact-Taglet</artifactId>
  25. <version>version-Taglet</version>
  26. </tagletArtifact>
  27. ...
  28. </configuration>
  29. </plugin>
  30. </plugins>
  31. ...
  32. </reporting> (or </build>)
  33. ...
  34. </project>

If you don't know the Taglets or if you want to auto-detect Taglet class names, you could use the <tagletArtifacts/> parameter:

  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. <tagletArtifacts>
  12. <tagletArtifact>
  13. <groupId>group-FirstTaglet</groupId>
  14. <artifactId>artifact-FirstTaglet</artifactId>
  15. <version>version-FirstTaglet</version>
  16. </tagletArtifact>
  17.  
  18. <tagletArtifact>
  19. <groupId>group-SecondTaglet</groupId>
  20. <artifactId>artifact-SecondTaglet</artifactId>
  21. <version>version-SecondTaglet</version>
  22. </tagletArtifact>
  23. ...
  24. </tagletArtifacts>
  25. ...
  26. </configuration>
  27. </plugin>
  28. </plugins>
  29. ...
  30. </reporting> (or </build>)
  31. ...
  32. </project>