Generating multiple javadoc reports using maven-javadoc-plugin and Maven 3
Asked Answered
D

1

6

We use a custom doclet to generate a report from custom javadoc tags, and use the Maven site plugin and javadoc plugin to generate both this report and the regular java API docs.

The section of the POM looks like this:

<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>

Under Maven 2, this works fine, but in Maven 3 only one report is generated, that being the last one specified in the POM (confimed by swapping the reportSet elements).

After some experimenting I discovered that if I changed the regular report's goal from "javadoc" to "test-javadoc", then I got output from both report sets. So the problem seems to be that with Maven 3 I can't generate two reports that use the same javadoc-plugin goal.

Is this a bug, or is there some congifuration I've missed? I moved the maven-javadoc-plugin setup from reporting to the configuration of the site plugin as described at http://maven.apache.org/plugins/maven-site-plugin-3.0-beta-3/maven-3.html, to no avail. I'm using Maven 3.0.4, maven-site-plugin 3.0-beta-3 and maven-javadoc-plugin 2.8.1.

Thanks!

Davidadavidde answered 4/4, 2012 at 10:36 Comment(3)
First try to update the maven-site-plugin to 3.0 maven.apache.org/plugins/maven-site-pluginAdvisement
Same problem with 3.0: I went to 3.0-beta-3 as that matched the version used in the examples I could find.Davidadavidde
Did you crack this in the end? Thanks for posting that test-javadoc works, I hadn't figured that out for myself (I've found the same issue you report above)Maxwellmaxy
C
4

It's a bug in maven-reporting-exec component.

Report sets are kept in a map using the report goal as a key.

Casseycassi answered 7/1, 2013 at 14:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.