maven-javadoc-plugin breaks mvn release:perform

Another way to fix this issue is to add the following property :

...
<properties>
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
...
</properties>

in your pom.xml


There seems to be a cascade of issues regarding update to maven-javadoc-plugin. See https://issues.apache.org/jira/browse/MJAVADOC-408.

I can see some benefit in having mvn use the latest versions of "built-in" plugins if not otherwise specified (vs. a "pinned version" for a given Maven version), but it means plug-in maintainers are obliged to do regression testing against every version of Maven upon a plugin release. Maybe something was missed.

One workaround would be to explicitly specify the previous version of maven-javadoc-plugin in your organization's super POM, or alternatively, the project POM if it's not possible to change the super POM in a hurry:

<pluginManagement>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-javadoc-plugin</artifactId>
      <version>2.9.1</version>
    </plugin>
  </plugins>
</pluginManagement>

Our CI rig (Jenkins) hit the same problem today. Hopefully a new maven-javadoc-plugin will get pushed with it's dependency tree updated (if that is indeed the issue). FWIW, we were on 3.0.5 (ya, sad for a variety of reasons).

Update 2014-09-24

This whole hubub seems to have originated in the response of maven-javadoc-plugin maintainers to an yet-to-be-closed issue in java-1.8.0-openjdk in MJAVADOC-398. I have no idea why anyone would release a breaking work-around for a unresolved downstream project defect.

Update 2014-10-02

MJAVADOC-406 has been resolved and there is a 2.10.1 version of maven-javadoc-plugin available in Maven Central and likely many repositories near you.

Builds with un-pinned javadoc plugin version should be returning to normal now.

Moral of the Story

Maven-folk, you have been warned. Lock down your plug-in dependencies because they could go rogue.

P.S., MJAVADOC-408 has been closed as a duplicate of MJAVADOC-407.


mvn release package uses a special profile by default. This default profile includes some default plugin configurations (such as automatically attach-javadocs as part of the build).

This is the reason your build is only failing on mvn release:perform and not on mvn clean install.

If you want to control in a better way what configuration is going to be used (for example if you don't want javadocs, or you want to provide your own configuration for the javadocs), you can try disabling this default profile by adding the configuration: <useReleaseProfile>false</useReleaseProfile>

or in the command-line: mvn release:perform -DuseReleaseProfile=false

More info here: http://maven.apache.org/maven-release/maven-release-plugin/perform-mojo.html#useReleaseProfile

Tags:

Java

Maven