我已将以下依赖项添加到Jenkins插件
<!-- https://mvnrepository.com/artifact/org.apache.ant/ant -->
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.1</version>
</dependency>
我在mvn hpi:run
[INFO] --- maven-enforcer-plugin:1.4.2.jenkins-1:enforce (display-info) @ osf-builder-suite-for-sfcc-deploy ---
[INFO] Restricted to JDK 1.7 yet org.apache.ant:ant:jar:1.10.1:compile contains org/apache/tools/ant/AntClassLoader$ResourceEnumeration.class targeted to JDK 1.8
[INFO] Restricted to JDK 1.7 yet org.apache.ant:ant-launcher:jar:1.10.1:compile contains org/apache/tools/ant/launch/AntMain.class targeted to JDK 1.8
知道发生了什么,我该怎么办?
答案 0 :(得分:1)
从1.10.0开始,Ant需要Java 8,而你的项目显然被限制为编译为JDK 7(Maven通过maven-enforcer-plugin检测到这种不兼容性。来自release note:
Ant 1.10.x在编译或构建时需要Java8或更新版本。
1.9.x系列将与Java5保持兼容。
切换到1.9.x版本应解决错误。