通过Jenkins

时间:2017-02-11 07:01:07

标签: java maven jenkins

尝试在Jenkins中构建我的maven项目时出现以下错误。

[ERROR] Failed to execute goal com.oracle.adf.plugin:ojmake:12.2.1-0-0:compile (default) on project TestApp: Execution default of goal com.oracle.adf.plugin:ojmake:12.2.1-0-0:compile failed: Unable to load the mojo 'compile' in the plugin 'com.oracle.adf.plugin:ojmake:12.2.1-0-0' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: oracle/jdeveloper/deploy/maven/OjmakeMojo : Unsupported major.minor version 52.0
[ERROR] -----------------------------------------------------
[JENKINS] Archiving C:\test\pom.xml to com.test/test/3.7.2/TestApp-3.7.2.pom
[ERROR] realm =    plugin>com.oracle.adf.plugin:ojmake:12.2.1-0-0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/maven-repository/com/oracle/adf/plugin/ojmake/12.2.1-0-0/ojmake-12.2.1-0-0.jar
[ERROR] urls[1] = file:/C:/maven-repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------

詹金斯版本:2.19.2

Maven版本:3.3.9

jdk版本:1.7.0_79

我在我的pom.xml文件中使用maven编译器插件,目标和源集是1.7。我在Windows环境中工作。确保根据需要设置PATH变量。但是,詹金斯的工作仍然失败了。 如何克服这个错误?

3 个答案:

答案 0 :(得分:0)

显示的版本号描述了类文件兼容的JRE的版本。 Java SE 8 = 52 你可能有一个需要java 1.8的依赖

推荐 - https://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html

答案 1 :(得分:0)

这似乎是java不匹配。 配置Jenkins Jobs使用 JDK 8
它可以在" Manage Jenkins "选项或您可以使其特定于" 配置"工作中的选项。

答案 2 :(得分:0)

通过在源代码中的所有pom.xml文件中将ojmake.exe替换为ojmake文件来解决此问题。

JDeveloper提供多种类型的ojmake文件,使用Linux命令'file'检查文件类型,并检查它是否是Linux可执行文件。

相关问题