My parent pom exlicitly declares a dependence on maven-javadoc-plugin 2.9.1 in both
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
</plugin>
...
and
<reporting>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
...
(see Maven plugin version in pom (seemingly) ignored ) and mvn help:effective-pom
shows 2.9.1 is being used. However, the build is using 2.10 which is causes build failures (see
maven-javadoc-plugin breaks mvn release:perform and http://jira.codehaus.org/browse/MJAVADOC-407 )
mvn help:describe -DgroupId=org.apache.maven.plugins \
-DartifactId=maven-javadoc-plugin
shows
Name: Apache Maven Javadoc Plugin
Description: The Apache Maven Javadoc Plugin is a plugin that uses the
javadoc tool for generating javadocs for the specified project.
Group Id: org.apache.maven.plugins
Artifact Id: maven-javadoc-plugin
Version: 2.10
Goal Prefix: javadoc
Meanwhile,
mvn dependency:resolve-plugins
shows
[INFO] Plugin Resolved: maven-javadoc-plugin-2.9.1.jar
Yet when I run the build, mvn uses 2.10 instead, causing a build failure.
How can I force maven to use 2.9.1 and not the broken 2.10?
(I'm using Maven 3.2.1)
pluginManagement: is an element that is seen along side plugins. Plugin Management contains plugin elements in much the same way, except that rather than configuring plugin information for this particular project build, it is intended to configure project builds that inherit from this one.
A plugin is an extension to Maven, something used to produce your artifact (maven-jar-plugin for an example, is used to, you guess it, make a jar out of your compiled classes and resources). A dependency is a library that is needed by the application you are building, at compile and/or test and/or runtime time.
Introduction. In Maven, there are two kinds of plugins, build and reporting: Build plugins are executed during the build and configured in the <build/> element. Reporting plugins are executed during the site generation and configured in the <reporting/> element.
Be sure that you are looking at the right dependency. We are seeing that 2.9.1 as specified is being used for site reports but 2.10 is being used by the build. I believe you should specify it in your
<build><plugins>
section as well.
We just verified that we were suffering the same problem. We had the plugin version in the reporting plugins section but not build plugins. Once we added it to the build plugins section, the issue was resolved. The reason it needed to be in build plugins was because it was being used in the prepare deploy phase to build a javadoc jar. This happens separately from generating javadoc for the site reports.
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