Skip to content

Commit c73c16f

Browse files
committed
Configure JDK 22 compatibility build on CI
This commit does not enable this build right now as testing libraries are not ready yet for JDK 22. See gh-31459
1 parent c6b86af commit c73c16f

File tree

6 files changed

+46
-3
lines changed

6 files changed

+46
-3
lines changed

ci/images/ci-image/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ RUN ./setup.sh
77
ENV JAVA_HOME /opt/openjdk/java17
88
ENV JDK17 /opt/openjdk/java17
99
ENV JDK21 /opt/openjdk/java21
10+
ENV JDK22 /opt/openjdk/java22
1011

1112
ENV PATH $JAVA_HOME/bin:$PATH

ci/images/get-jdk-url.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ case "$1" in
88
java21)
99
echo "https://download.bell-sw.com/java/21.0.1+12/bellsoft-jdk21.0.1+12-linux-amd64.tar.gz"
1010
;;
11+
java22)
12+
echo "https://download.java.net/java/early_access/jdk22/19/GPL/openjdk-22-ea+19_linux-x64_bin.tar.gz"
13+
;;
1114
*)
1215
echo $"Unknown java version"
1316
exit 1

ci/images/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ curl https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.4/c
2020

2121
mkdir -p /opt/openjdk
2222
pushd /opt/openjdk > /dev/null
23-
for jdk in java17 java21
23+
for jdk in java17 java21 java22
2424
do
2525
JDK_URL=$( /get-jdk-url.sh $jdk )
2626
mkdir $jdk

ci/pipeline.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ resources:
121121
access_token: ((github-ci-status-token))
122122
branch: ((branch))
123123
context: jdk21-build
124+
- name: repo-status-jdk22-build
125+
type: github-status-resource
126+
icon: eye-check-outline
127+
source:
128+
repository: ((github-repo-name))
129+
access_token: ((github-ci-status-token))
130+
branch: ((branch))
131+
context: jdk22-build
124132
- name: slack-alert
125133
type: slack-notification
126134
icon: slack
@@ -241,6 +249,32 @@ jobs:
241249
<<: *slack-fail-params
242250
- put: repo-status-jdk21-build
243251
params: { state: "success", commit: "git-repo" }
252+
- name: jdk22-build
253+
serial: true
254+
public: true
255+
plan:
256+
- get: ci-image
257+
- get: git-repo
258+
- put: repo-status-jdk22-build
259+
params: { state: "pending", commit: "git-repo" }
260+
- do:
261+
- task: check-project
262+
image: ci-image
263+
file: git-repo/ci/tasks/check-project.yml
264+
privileged: true
265+
timeout: ((task-timeout))
266+
params:
267+
TEST_TOOLCHAIN: 22
268+
<<: *build-project-task-params
269+
on_failure:
270+
do:
271+
- put: repo-status-jdk22-build
272+
params: { state: "failure", commit: "git-repo" }
273+
- put: slack-alert
274+
params:
275+
<<: *slack-fail-params
276+
- put: repo-status-jdk22-build
277+
params: { state: "success", commit: "git-repo" }
244278
- name: stage-milestone
245279
serial: true
246280
plan:
@@ -392,7 +426,7 @@ jobs:
392426

393427
groups:
394428
- name: "builds"
395-
jobs: ["build", "jdk21-build"]
429+
jobs: ["build", "jdk21-build", "jdk22-build"]
396430
- name: "releases"
397431
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release"]
398432
- name: "ci-images"

ci/scripts/build-project.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ source $(dirname $0)/common.sh
55
repository=$(pwd)/distribution-repository
66

77
pushd git-repo > /dev/null
8-
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false -Porg.gradle.java.installations.fromEnv=JDK17,JDK21 \
8+
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false -Porg.gradle.java.installations.fromEnv=JDK17,JDK21,JDK22 \
99
--no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository
1010
popd > /dev/null

gradle/toolchains.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ plugins.withType(JavaPlugin).configureEach {
5454
javaLauncher = javaToolchains.launcherFor {
5555
languageVersion = testLanguageVersion
5656
}
57+
// Enable Java experimental support in Bytebuddy
58+
// Remove when JDK 22 is supported by Mockito
59+
if (testLanguageVersion == JavaLanguageVersion.of(22)) {
60+
jvmArgs("-Dnet.bytebuddy.experimental=true")
61+
}
5762
}
5863
}
5964
}

0 commit comments

Comments
 (0)