简体   繁体   English

Jenkins 能否支持相同 Maven 作业的 2 个 Java 版本?

[英]Can Jenkins support 2 Java versions for same Maven job?

We are trying to upgrade Java and have modified pom.xml to use the new version in source and target for the build.我们正在尝试升级 Java 并修改 pom.xml 以在源和目标中使用新版本进行构建。 Jenkins job is currently failing with error: Jenkins 作业当前失败并出现错误:

Fatal error compiling: invalid target release: 11.致命错误编译:无效的目标版本:11。

We have multiple release branches being developed in parallel.我们有多个并行开发的发布分支。 Most of them are still using old Java and should be built with older version.他们中的大多数仍在使用旧的 Java 并且应该使用旧版本构建。 Only for one release branch we want the new Java version.仅对于一个发布分支,我们需要新的 Java 版本。 Is it possible to configure Jenkins in such a way?是否可以以这种方式配置 Jenkins?

My understanding is Jenkins JAVA HOME need to be updated to match the target version.我的理解是 Jenkins JAVA HOME 需要更新以匹配目标版本。

Manage JenkinsGlobal Tool ConfigurationJDK installations...Add JDK管理 Jenkins全局工具配置JDK 安装...添加 JDK

<project> → ConfigureGeneralJDK ( JDK to be used for this project ) <项目> →配置常规JDK用于此项目的 JDK

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM