Skip to content

Commit

Permalink
Always use Java 21 for the Jenkins build
Browse files Browse the repository at this point in the history
And use the toolchain for Java 17 and 11
  • Loading branch information
LorenzoBettini committed Aug 10, 2024
1 parent 4900f56 commit f0dd214
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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' : ''}
"""
}
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 f0dd214

Please sign in to comment.