If you have a requirement or a plan to generate javadocs for your project source code and you are using Maven as your build tool, copy the following onto your pom.xml in the build/plugins section.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<configuration>
<reportOutputDirectory>C:/Project/apiDocs</reportOutputDirectory>
</configuration>
<executions>
<execution>
<id>aggregate</id>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<configuration>
<reportOutputDirectory>C:/Project/apiDocs</reportOutputDirectory>
</configuration>
<executions>
<execution>
<id>aggregate</id>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
Also dont forget to add javadoc:aggregate to the mvn goal/tasks list for the javadocs to get generated.
mvn -e -s application\settings.xml -Denvironment=development -Dmaven.test.skip=false clean install javadoc:aggregate
Note that the javadocs will be generated in the configured reportOutputDirectory. If you are working on a project that has a parent POM which invokes multiple child POMs, add this to the parent POM, the aggregate option will generate one javadoc for all the set of modules invoked from inside the parent without any changes to the child POMs. You can always refer to the Maven Javadoc Plugin page for more information and options.
No comments:
Post a Comment