Reputation: 4233
I have a Maven multi module project like this:
foo-parent
foo-module
foo-module-new
foo-other-module1
foo-other-module2
pom.xml
And when calling mvn javadoc:aggregate
in foo-parent, I want to exclude the module foo-module from Javadoc generation.
Exclusion by package name with the parameter excludePackageNames
doesn't work in my case because foo-module and foo-module-new have the same package name.
Upvotes: 3
Views: 3264
Reputation: 1082
Since maven-javadoc-plugin:3.2.0
you can use the skippedModules
property to provide a comma separated list of modules to skip. For instance the following configuration would skip the foo-module
module:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<reportSets>
<reportSet>
<id>aggregate</id>
<configuration>
<skippedModules>foo-module</skippedModules>
</configuration>
</reportSet>
</reportSets>
</plugin>
Alternatively, you may use the maven.javadoc.skippedModules
user property to achieve the same outcome.
Upvotes: 3
Reputation: 2475
Use maven profile.
add in your pom :
<profiles>
<profile>
<id>javadoc</id>
<modules>
<module>module_include_javadoc1</module>
<module>module_include_javadoc2</module>
</modules>
</profile>
</profiles>
Run this:
mvn javadoc:aggregate -Pjavadoc
Upvotes: 1
Reputation: 4105
Launch the following to generate javadocs only for foo-other-module1
and foo-other-module2
modules (note: always include the aggregator module, in this case foo-parent
):
mvn javadoc:aggregate -pl :foo-parent,:foo-other-module1,:foo-other-module2
Since Maven 3.2.1, you can also exclude modules from your reactor, so the above simplifies to
mvn javadoc:aggregate -pl '!foo-module'
Upvotes: 6