From 4900f56974d72a04b117c2364703603654706cbc Mon Sep 17 00:00:00 2001 From: Lorenzo Bettini Date: Sat, 10 Aug 2024 11:47:19 +0200 Subject: [PATCH 1/2] Always use Java 17 for the build and rely on the toolchain to force compilation and tests with other Java versions. I left comments to document what I think it's the semantics of those Jenkinsfile parts --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a0fd182daed..46d3a62f1d8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,9 +25,9 @@ pipeline { } tools { - jdk "temurin-jdk11-latest" + // the Java version we use to run the build (minimal requirement for Maven/Tycho) + // we force other Java versions through Maven toolchains jdk "temurin-jdk17-latest" - jdk "temurin-jdk21-latest" } stages { @@ -58,6 +58,7 @@ pipeline { stage('Maven/Tycho Build & Test') { environment { MAVEN_OPTS = "-Xmx1500m" + // set all Java versions needed by our toolchains.xml JAVA_HOME_11_X64 = tool(type:'jdk', name:'temurin-jdk11-latest') JAVA_HOME_17_X64 = tool(type:'jdk', name:'temurin-jdk17-latest') JAVA_HOME_21_X64 = tool(type:'jdk', name:'temurin-jdk21-latest') From f0dd2146d6426b6e7f72b6ded5b92b632d027d66 Mon Sep 17 00:00:00 2001 From: Lorenzo Bettini Date: Sat, 10 Aug 2024 16:07:17 +0200 Subject: [PATCH 2/2] Always use Java 21 for the Jenkins build And use the toolchain for Java 17 and 11 --- Jenkinsfile | 7 ++++--- pom.xml | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 46d3a62f1d8..4354ff9c074 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,9 +25,9 @@ pipeline { } tools { - // the Java version we use to run the build (minimal requirement for Maven/Tycho) - // we force other Java versions through Maven toolchains - jdk "temurin-jdk17-latest" + // the Java version we use to run the build + // we force the effective JDK version for compilation/testing through Maven toolchains + jdk "temurin-jdk21-latest" } stages { @@ -68,6 +68,7 @@ pipeline { sh """ ./full-build.sh --tp=${selectedTargetPlatform()} \ ${javaVersion() == 11 ? '--toolchains releng/toolchains.xml -Pstrict-jdk-11' : ''} \ + ${javaVersion() == 17 ? '--toolchains releng/toolchains.xml -Pstrict-jdk-17' : ''} \ ${javaVersion() == 21 ? '-Pstrict-jdk-21' : ''} """ } diff --git a/pom.xml b/pom.xml index 04f8b31934b..a3d4be6af61 100644 --- a/pom.xml +++ b/pom.xml @@ -445,8 +445,37 @@ + + strict-jdk-17 + + + + org.apache.maven.plugins + maven-toolchains-plugin + + + + toolchain + + + + + + + + 17 + + + + + + + strict-jdk-21 +