Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deal with Java 11, 17, and 21 for the Jenkins build #3140

Merged
merged 2 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pipeline {
}

tools {
jdk "temurin-jdk11-latest"
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"
}

Expand Down Expand Up @@ -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')
Expand All @@ -67,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' : ''}
"""
}
Expand Down
29 changes: 29 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,37 @@
</plugins>
</build>
</profile>
<profile>
<id>strict-jdk-17</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<!-- Toolchain selected by maven/tycho-compiler for compilation and maven/tycho-surefire as JRE of launched test-runtimes-->
<version>17</version>
</jdk>
</toolchains>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>strict-jdk-21</id>
<!--
Here we don't use the toolchain relying on the effective Java version used for the build
-->
<properties>
<!--
Since the Xtend compiler generates Java code using new API introduced in Java 21,
Expand Down
Loading