This is my parent pom.xml
file (part of it) in a multi-module project:
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
...
This plugin is inherited in all sub-modules and I don't think it's a correct approach. When I'm running mvn javadoc:aggregate
the documentation is generated in target/site/apidoc
, but the log is full of warnings:
...
[WARNING] Removing: aggregate from forked lifecycle,
to prevent recursive invocation.
...
What am I doing wrong?
You need to enable aggregation for this plugin:
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<aggregate>true</aggregate> <!-- this enables aggretation -->
</configuration>
</plugin>
On the commandline type:
mvn javadoc:aggregate
Edit:
Okay, I did some digging into maven plugin's jira and found that all the javadoc plugin mojos have been annotated with @aggregator. But there seem to be problems with maven's aggregator the issue for which has been filed here
There are also related bugs here and here and some more
This seems to be a blocker issue with maven's aggregator since some plugins like e.g. clover wont run.
To to summarize, you are doing nothing wrong
Just switch back to earlier versions of maven-javadoc-plugin that does not use @aggregator mojo annotation and you will not get the warnings (unless you are using certain feature of the javadoc plugin thats not available in earlier version)
On a side note, If you run the javadoc plugin as report then the @aggregator is ignored.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With