Skip to content

Commit 5ee98ee

Browse files
authored
chore: migrate to java 21 (#5163)
1 parent d77d901 commit 5ee98ee

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

.devcontainer/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/java/.devcontainer/base.Dockerfile
22

33
# [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 11, 17, 11-bullseye, 17-bullseye, 11-buster, 17-buster
4-
ARG VARIANT="17-bullseye"
5-
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}
4+
ARG VARIANT="21-bullseye"
5+
FROM mcr.microsoft.com/vscode/devcontainers/java:1.1.0-${VARIANT}
66

77
# [Option] Install Maven
88
ARG INSTALL_MAVEN="false"

.devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// Update the VARIANT arg to pick a Java version: 11, 17
99
// Append -bullseye or -buster to pin to an OS version.
1010
// Use the -bullseye variants on local arm64/Apple Silicon.
11-
"VARIANT": "17-bullseye",
11+
"VARIANT": "21-bullseye",
1212
// Options
1313
"INSTALL_MAVEN": "true",
1414
"INSTALL_GRADLE": "true",

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v4
9-
- name: Set up JDK 17
9+
- name: Set up JDK
1010
uses: actions/setup-java@v4
1111
with:
12-
java-version: 17
12+
java-version: 21
1313
distribution: 'adopt'
1414
- name: Build with Maven
1515
run: mvn --batch-mode --update-snapshots verify

.github/workflows/codeql.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
- name: Checkout repository
2727
uses: actions/checkout@v4
2828

29-
- name: Set up JDK 17
29+
- name: Set up JDK
3030
uses: actions/setup-java@v4
3131
with:
32-
java-version: 17
32+
java-version: 21
3333
distribution: 'adopt'
3434

3535
- name: Initialize CodeQL

.gitpod.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM gitpod/workspace-java-17:2024-05-13-09-12-40
1+
FROM gitpod/workspace-java-21:2024-05-15-13-36-34
22

33
ENV LLVM_SCRIPT="tmp_llvm.sh"
44

pom.xml

+6-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<maven.compiler.source>17</maven.compiler.source>
14-
<maven.compiler.target>17</maven.compiler.target>
13+
<maven.compiler.source>21</maven.compiler.source>
14+
<maven.compiler.target>21</maven.compiler.target>
1515
<assertj.version>3.25.3</assertj.version>
1616
</properties>
1717

@@ -73,15 +73,17 @@
7373
<artifactId>maven-compiler-plugin</artifactId>
7474
<version>3.13.0</version>
7575
<configuration>
76-
<source>17</source>
77-
<target>17</target>
76+
<source>21</source>
77+
<target>21</target>
7878
<compilerArgs>
7979
<arg>-Xlint:all</arg>
8080
<arg>-Xlint:-auxiliaryclass</arg>
8181
<arg>-Xlint:-rawtypes</arg>
8282
<arg>-Xlint:-serial</arg>
8383
<arg>-Xlint:-try</arg>
8484
<arg>-Xlint:-unchecked</arg>
85+
<arg>-Xlint:-lossy-conversions</arg>
86+
<arg>-Xlint:-this-escape</arg>
8587
<arg>-Werror</arg>
8688
</compilerArgs>
8789
</configuration>

0 commit comments

Comments
 (0)