我需要更改Maven-plugin-javadoc的版本,该版本默认包含在Maven的release-profile中(在mvn release:perform
期间。默认包含的版本是最新版本,但是我需要使用较旧的版本与Java 6兼容的版本。
我尝试使用下面的代码,但它不起作用(pom.xml):
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.1</version>
</plugin>
</plugins>
</build>
</profile>
</profiles>
执行mvn release:perform
后出现实际错误结果:
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:jar (attach-javadocs) on project XX: Execution attach-javadocs of goal org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:jar failed: Unable to load the mojo 'jar' in the plugin 'org.apache.maven.plugins:maven-javadoc-plugin:3.1.1' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/apache/maven/plugins/javadoc/JavadocJar : Unsupported major.minor version 51.0
我希望将2.10.1版用于maven-javadoc-plugin。