当我试图在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] -----------------------------------------------------
Jenkins版本: 2.19.2
Maven版本: 3.3.9
jdk版本: 1.7.0_79
我在我的pom.xml文件中使用了maven编译器插件,目标和源代码设置为1.7。我在Windows环境下工作。已确保根据需要设置PATH变量。但是,Jenkins作业仍然失败。如何克服这个错误?
发布于 2017-02-11 15:26:03
显示的版本号描述了类文件与之兼容的JRE版本。Java SE 8= 52可能是您有需要java 1.8的依赖项
参考- https://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html
发布于 2018-06-08 03:58:19
通过将源代码中所有pom.xml文件中的ojmake.exe替换为ojmake文件,可以解决此问题。
JDeveloper提供了多种类型的ojmake文件,使用Linux命令' file‘检查文件的类型,并检查它是否是Linux可执行文件。
https://stackoverflow.com/questions/42173251
复制相似问题