Create multiple javadoc reports using maven-javadoc-plugin and Maven 3

We use a custom doclet to create a report from custom javadoc tags and use the Maven site plugin and javadoc plugin to create both this report and regular Java API documents.

The POM section is as follows:

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <reportSets> <reportSet> <id>html</id> <reports> <report>javadoc</report> </reports> </reportSet> <reportSet> <id>custom_report</id> <configuration> ... </configuration> <reports> <report>javadoc</report> </reports> </reportSet> </reportSets> </plugin> 

In Maven 2, this works fine, but in Maven 3, only one report is generated, which is the last one specified in the POM (via the exchange of reportSet elements).

After some experimentation, I found that if I changed the purpose of the regular report from "javadoc" to "test-javadoc", then I got output from both sets of reports. So the problem is that with Maven 3 I cannot create two reports that use the same javadoc-plugin project.

Is this a mistake, or is there some sort of conquest that I missed? I moved the maven-javadoc-plugin setting from reporting to the site plugin configuration as described in http://maven.apache.org/plugins/maven-site-plugin-3.0-beta-3/maven-3.html , without help . I am using Maven 3.0.4, maven-site-plugin 3.0-beta-3 and maven-javadoc-plugin 2.8.1.

Thanks!

+6
source share
1 answer

This is a bug in the maven-reporting-exec component .

Report sets are stored on the map using the report target as a key.

+4
source

Source: https://habr.com/ru/post/912376/


All Articles