2017-02-11 42 views
0

我在尝试在Jenkins中构建我的maven项目时出现以下错误。通过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

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

回答

0

这似乎是一个Java不匹配。 配置你是Jenkins要使用的作业JDK 8
它可以在“管理Jenkins”选项下完成,或者您可以在作业内的“配置”选项下针对作业。

+0

安装了Jdk8并配置了我的Jenkins作业以使用此JDK版本。仍然有错误。 '[错误]无法执行目标com.oracle.adf.plugin:ojmake:12.2.1-0-0:编译(默认)项目TestAppView:无法运行程序“$ {env.ORACLE_HOME}/jdeveloper/jdev/bin /ojmake.exe“:CreateProcess error = 2,系统找不到指定的文件 - > [Help 1]' – akr

+0

我可以看到java错误已经消失,但是现在看起来好像是缺少文件问题 '无法运行程序“$ {env.ORACLE_HOME} /jdeveloper/jdev/bin/ojmake.exe” 此行明确指出名为“ojmake.exe”的文件在所提及的路径 中缺失,即**“$ { env.ORACLE_HOME} /jdeveloper/jdev/bin/ojmake.exe“**。 因此,请将所需的文件(ojmake.exe)放在该位置。让我们检查一下它是否执行得更远。 手指交叉。 – vijayraj34