From 416287052da212f65d934d50a0fb7fa19fc3598a Mon Sep 17 00:00:00 2001 From: yangjie01 Date: Mon, 22 Jun 2026 20:09:05 +0800 Subject: [PATCH] ci: add Java 25 to the JNI build-and-test matrix Java 25 is the September 2025 LTS; add it alongside 11/17/21 so the JNI bindings are exercised on the current LTS. The build targets maven.compiler.release 11, so the newer JDK only affects the build/test runtime, not the emitted bytecode. spotless's google-java-format step cannot run on Java 25: gjf 1.22.0 calls a com.sun.tools.javac API (Log$DeferredDiagnosticHandler.getDiagnostics) whose signature changed in JDK 25, and no gjf release runs on JDK 25 without dropping JDK 11/17 support (gjf >= 1.34 supports 25 but requires JDK 21+ to run). So the format gate is skipped on the Java 25 job only -- it is JDK-independent and stays enforced on 11/17/21. spotless is also bound into the build lifecycle (validate phase), so the build passes -Dspotless.skip=true on 25 in addition to skipping the standalone step. --- .github/workflows/java.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index 83403988244..4d95c666a93 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -54,7 +54,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - java-version: [11, 17, 21] + java-version: [11, 17, 21, 25] name: Build and Test with Java ${{ matrix.java-version }} steps: - name: Checkout repository @@ -79,7 +79,13 @@ jobs: distribution: temurin java-version: ${{ matrix.java-version }} cache: "maven" + # Skip the format gate on Java 25: google-java-format 1.22.0 (pinned via + # spotless) reaches into com.sun.tools.javac internals and throws + # NoSuchMethodError on JDK 25's javac. No google-java-format release runs + # on JDK 25 without also dropping JDK 11/17 support, so we exclude 25 from + # the (JDK-independent, already-enforced-on-11/17/21) style check instead. - name: Running code style check with Java ${{ matrix.java-version }} + if: matrix.java-version != '25' working-directory: java run: | mvn spotless:check @@ -91,4 +97,7 @@ jobs: env: LANCE_INTEGRATION_TEST: "1" run: | - mvn install + # spotless is also bound into the build lifecycle, so on Java 25 the + # format gate must be skipped here too (-Dspotless.skip=true), not just + # in the standalone step above. + mvn install ${{ matrix.java-version == '25' && '-Dspotless.skip=true' || '' }}