Skip to content

Commit

Permalink
Merge pull request #3140 from eclipse/lb_3135
Browse files Browse the repository at this point in the history
Deal with Java 11, 17, and 21 for the Jenkins build
  • Loading branch information
LorenzoBettini authored Aug 10, 2024
2 parents d4632c2 + f0dd214 commit 2737b36
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
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

0 comments on commit 2737b36

Please sign in to comment.