2

Is there a fool-proof way to generate aggregate Javadocs for a multi-module Maven reactor project in a Jenkins job using the Maven Release Plugin Plugin?

My problem is, after the maven-release-plugin has updated all POM versions, the next build will break since javadoc:aggregate fails on the reactor POM, given that the referenced versions of the module artifacts do not yet exist.

My workaround is to run the build once with the maven-javadoc-plugin disabled, using a profile. Then after re-enabling the maven-javadoc-plugin the next build will pass.

This is rather a hack, and I wonder if I'm just missing anything simple...

Here is my maven-javadoc-plugin configuration from the reactor POM:

    <profile>
        <id>javadoc</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>aggregate-javadoc</id>
                            <phase>post-integration-test</phase>
                            <goals>
                                <goal>aggregate</goal>
                            </goals>
                        </execution>
                    </executions>
                    <inherited>false</inherited>
                </plugin>
            </plugins>
        </build>
    </profile>
Harald Wellmann
  • 12,615
  • 4
  • 41
  • 63

1 Answers1

0

I was just facing same issue and after a bit of playing with it, it turned out that using aggregate-jar goal instead works just fine (it generates basic aggregated javadoc and in addition jar file, but the latter can be discarded).

I think this is cause by the different default lifecycle phases to which goal execution is bound and additional execution of generate-sources phase in case of aggregate phase:

Wojtek
  • 1,845
  • 1
  • 14
  • 33