I have a multi-module project. In the parent pom (which is not the aggregator POM), I'm using maven-javadoc-plugin
. It has two executions, both in the package
phase, one for the jar
goal, and one for the aggregate-jar
goal.
This nicely generates a full aggregate Javadoc jar of all the (non-test) classes in the build.
What I need to be able to do is generate TWO Javadoc jars, one exactly as it's generating now, but another that covers a limited set of modules, and possibly excludes particular packages or classes.
I thought perhaps that this would require adding TWO "execution" elements, both for the "aggregate-jar" task, but with different configuration values. This didn't appear to do anything. It just generated a single Javadoc tree, for "all" the classes. How do I get this done?
This was my attempt to make this happen:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
<executions>
<execution>
<id>module-javadoc-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<show>protected</show>
<detectLinks>true</detectLinks>
</configuration>
</execution>
<execution>
<id>aggregated-documentation-all</id>
<phase>package</phase>
<inherited>false</inherited>
<goals>
<goal>aggregate-jar</goal>
</goals>
<configuration>
<sourcepath>
../something-api:
../something-impl:
../something-else-api:
../something-else-impl:
</sourcepath>
<destDir>all</destDir>
<finalName>all</finalName>
<show>protected</show>
<detectLinks>true</detectLinks>
</configuration>
</execution>
<execution>
<id>aggregated-documentation-interface</id>
<phase>package</phase>
<inherited>false</inherited>
<goals>
<goal>aggregate-jar</goal>
</goals>
<configuration>
<sourcepath>
../something-api:
../something-else-api:
</sourcepath>
<destDir>interface</destDir>
<finalName>interface</finalName>
<show>protected</show>
<detectLinks>true</detectLinks>
</configuration>
</execution>
</executions>
</plugin>