Selective Javadocs Reports

To run the Javadocs reports selectively, you need to include only the Javadocs reports that you prefer. As said in the FAQ, the configuration depends on the <build/> tag or <reporting/> tag used.

Using <build/> Tag

  1. <project>
  2. ...
  3. <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. <!-- Default configuration for all reports -->
  11. ...
  12. </configuration>
  13. <executions>
  14. <execution>
  15. <goals>
  16. <goal>javadoc</goal>
  17. <goal>test-javadoc</goal>
  18. </goals>
  19. <phase>site</phase>
  20. <configuration>
  21. <!-- Specific configuration for the given reports -->
  22. ...
  23. </configuration>
  24. </execution>
  25. </executions>
  26. </plugin>
  27. </plugins>
  28. </build>
  29. ...
  30. </project>

Since the phase is site, you need to call mvn site to generate the selected reports (only main and test javadocs).

Using <reporting/> Tag

  1. <project>
  2. ...
  3. <reporting>
  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. <!-- Default configuration for all reports -->
  11. ...
  12. </configuration>
  13. <reportSets>
  14. <reportSet>
  15. <id>default</id>
  16. <configuration>
  17. <!-- Specific configuration for the given reports -->
  18. ...
  19. </configuration>
  20. <reports>
  21. <report>javadoc</report>
  22. <report>test-javadoc</report>
  23. </reports>
  24. </reportSet>
  25. <reportSet>
  26. <id>aggregate</id>
  27. <configuration>
  28. <!-- Specific configuration for the given reports -->
  29. ...
  30. </configuration>
  31. <reports>
  32. <report>aggregate</report>
  33. </reports>
  34. </reportSet>
  35. </reportSets>
  36. </plugin>
  37. </plugins>
  38. </reporting>
  39. ...
  40. </project>

Just call mvn site to generate the selected reports (main, test and aggregate javadocs).