Skip to content

Commit 09a6ef7

Browse files
authored
feat: upgrade to Java 25 (Temurin LTS) (#222)
closes #192 ## Summary - Bumps all Java toolchain references from 21 → 25 (Temurin LTS) across build files, Dockerfile, and CI workflows - Fixes a Java 25 compile error: `lettuce-core` is `optional` in spring-data-redis' POM so Gradle omits it from the compile classpath; Java 25's `javac` now errors (not warns) when it can't resolve type annotations from a dependency's class files — fix is one `compileOnly` declaration in the dashboard module ## Changes | File | Change | |---|---| | `mise.toml` | `temurin-21` → `temurin-25` | | All 3 module `build.gradle` | toolchain + source/targetCompatibility 21 → 25 | | `build.gradle` | `lettuceVersion = '6.8.2.RELEASE'` | | `git-proxy-java-dashboard/build.gradle` | `compileOnly "io.lettuce:lettuce-core:${lettuceVersion}"` | | `Dockerfile` | `eclipse-temurin:21-jdk/jre` → `25-jdk/jre` with fresh pinned digests | | `ci.yml`, `codeql.yml`, `cve.yml` | `java-version: 21` → `java-version: 25` | ## Test plan - [x] `./gradlew compileJava` — clean - [x] `./gradlew test --rerun` — all unit tests pass - [x] `./gradlew :git-proxy-java-core:jacocoTestCoverageVerification --rerun` — coverage thresholds hold - [ ] CI (Docker smoke tests, CodeQL, e2e)
2 parents b4d193a + af62780 commit 09a6ef7

9 files changed

Lines changed: 23 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5
2727
with:
2828
distribution: temurin
29-
java-version: 21
29+
java-version: 25
3030
cache: gradle
3131

3232
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6
@@ -133,7 +133,7 @@ jobs:
133133
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5
134134
with:
135135
distribution: temurin
136-
java-version: 21
136+
java-version: 25
137137
cache: gradle
138138

139139
- name: Submit dependency graph
@@ -155,7 +155,7 @@ jobs:
155155
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5
156156
with:
157157
distribution: temurin
158-
java-version: 21
158+
java-version: 25
159159
cache: gradle
160160

161161
- name: Run e2e tests

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5
3333
with:
3434
distribution: temurin
35-
java-version: 21
35+
java-version: 25
3636
cache: gradle
3737

3838
- name: Set up Node

.github/workflows/cve.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5
6868
with:
6969
distribution: temurin
70-
java-version: 21
70+
java-version: 25
7171
cache: gradle
7272

7373
- name: Generate SBOM
@@ -115,7 +115,7 @@ jobs:
115115
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5
116116
with:
117117
distribution: temurin
118-
java-version: 21
118+
java-version: 25
119119
cache: gradle
120120

121121
- name: Cache NVD database

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# syntax=docker/dockerfile:1@sha256:2780b5c3bab67f1f76c781860de469442999ed1a0d7992a5efdf2cffc0e3d769
22

33
# ── Build stage ──────────────────────────────────────────────────────────────
4-
FROM docker.io/eclipse-temurin:21-jdk@sha256:e58e492628c1428ceb838afc1a1b8762673d5eaa09296f560c363daea0fdcf3b AS builder
4+
FROM docker.io/eclipse-temurin:25-jdk@sha256:c3a5cfd77c9a43dd95269a266290d365b79b174381d8336a3f76a7ae117beefa AS builder
55

66
# Install Node.js directly from the official distribution with SHA256 verification.
77
# To update: download the new tarball, verify against nodejs.org/dist/vX.Y.Z/SHASUMS256.txt,
88
# and update both NODE_VERSION and NODE_SHA256 below.
9+
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
10+
911
ARG NODE_VERSION=24.15.0
1012
ARG NODE_SHA256_AMD64=44836872d9aec49f1e6b52a9a922872db9a2b02d235a616a5681b6a85fec8d89
1113
ARG NODE_SHA256_ARM64=73afc234d558c24919875f51c2d1ea002a2ada4ea6f83601a383869fefa64eed
@@ -54,7 +56,7 @@ RUN sed -i \
5456
git-proxy-java-dashboard/build/install/git-proxy-java-dashboard/bin/git-proxy-java-dashboard
5557

5658
# ── Runtime stage ─────────────────────────────────────────────────────────────
57-
FROM docker.io/eclipse-temurin:21-jre@sha256:ff65ff0d43c73d2b675eb4b758665a5cb487e7df127436a9979f8172c144c819
59+
FROM docker.io/eclipse-temurin:25-jre@sha256:5742cdb98ef117621ad75f57475ab127db04f344d9c523307cc60b9955bdd676
5860

5961
WORKDIR /app
6062

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ ext {
4545
springVersion = '7.0.7'
4646
springSecurityVersion = '7.0.5'
4747
springSessionVersion = '4.0.3'
48+
lettuceVersion = '6.8.2.RELEASE'
4849

4950
// YAML
5051
snakeyamlVersion = '2.6'

git-proxy-java-core/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ plugins {
1111
}
1212

1313
java {
14-
sourceCompatibility = JavaVersion.VERSION_21
15-
targetCompatibility = JavaVersion.VERSION_21
14+
sourceCompatibility = JavaVersion.VERSION_25
15+
targetCompatibility = JavaVersion.VERSION_25
1616
toolchain {
17-
languageVersion = JavaLanguageVersion.of(21)
17+
languageVersion = JavaLanguageVersion.of(25)
1818
vendor = JvmVendorSpec.ADOPTIUM
1919
}
2020
}

git-proxy-java-dashboard/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ plugins {
55
}
66

77
java {
8-
sourceCompatibility = JavaVersion.VERSION_21
9-
targetCompatibility = JavaVersion.VERSION_21
8+
sourceCompatibility = JavaVersion.VERSION_25
9+
targetCompatibility = JavaVersion.VERSION_25
1010
toolchain {
11-
languageVersion = JavaLanguageVersion.of(21)
11+
languageVersion = JavaLanguageVersion.of(25)
1212
vendor = JvmVendorSpec.ADOPTIUM
1313
}
1414
}
@@ -170,6 +170,8 @@ dependencies {
170170
// MongoDB driver — compile-scoped because MongoSessionRepository uses the sync client directly.
171171
implementation "org.mongodb:mongodb-driver-sync:${mongoVersion}"
172172

173+
compileOnly "io.lettuce:lettuce-core:${lettuceVersion}"
174+
173175
// OpenAPI spec generation — core model + YAML/JSON serialisation only (no JAX-RS required).
174176
// The spec is built programmatically from Spring's RequestMappingHandlerMapping.
175177
implementation "io.swagger.core.v3:swagger-core-jakarta:${swaggerCoreVersion}"

git-proxy-java-server/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ plugins {
44
}
55

66
java {
7-
sourceCompatibility = JavaVersion.VERSION_21
8-
targetCompatibility = JavaVersion.VERSION_21
7+
sourceCompatibility = JavaVersion.VERSION_25
8+
targetCompatibility = JavaVersion.VERSION_25
99
toolchain {
10-
languageVersion = JavaLanguageVersion.of(21)
10+
languageVersion = JavaLanguageVersion.of(25)
1111
vendor = JvmVendorSpec.ADOPTIUM
1212
}
1313
}

mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[tools]
2-
java = "temurin-21"
2+
java = "temurin-25"
33
node = "24.15.0"

0 commit comments

Comments
 (0)