Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
258 views
in Technique[技术] by (71.8m points)

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. Jenkins job is currently failing with error:

Fatal error compiling: invalid target release: 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. Only for one release branch we want the new Java version. Is it possible to configure Jenkins in such a way?

My understanding is Jenkins JAVA HOME need to be updated to match the target version.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Manage JenkinsGlobal Tool ConfigurationJDK installations...Add JDK

<project> → ConfigureGeneralJDK (JDK to be used for this project)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...