diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ce6bad20b..2490cd1df0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,24 +17,26 @@ env: jobs: build: - name: "Build on JDK ${{ matrix.java }}" + name: "Build on JDK ${{ matrix.java }} (${{ matrix.java-package }})" strategy: matrix: - java: [ 17, 21 ] + java: [ 17, 21, 25 ] + java-package: [ jdk ] include: # Custom JDK 11 configuration because some of the plugins and test dependencies don't support it anymore, # but it is important to still test with a JDK version without Record classes - java: 11 + java-package: jdk # Disable Enforcer check which (intentionally) prevents using JDK 11 for building # Exclude 'test-graal-native-image' module because JUnit 6 requires >= Java 17 # Exclude 'proto' module because protobuf-maven-plugin requires >= Java 17 extra-mvn-args: -Denforcer.fail=false --projects '!test-graal-native-image,!proto' + # Additional build with JDK 25 and jmod files, to run ProGuard-related tests on JDK 25 as well + # Not needed for older JDK versions tested here, they include jmod files by default + # See also https://github.com/Guardsquare/proguard/issues/473 + # TODO: Remove this and the `java-package` config once ProGuard does not require jmod files anymore - java: 25 - # Disable Enforcer check which (intentionally) prevents using JDK 25 for building - # Exclude 'test-shrinker' because ProGuard does not support JDK 25 yet, see - # https://github.com/Guardsquare/proguard/issues/481 and https://github.com/Guardsquare/proguard/issues/473 - # TODO: Once ProGuard supports JDK 25, also remove the corresponding 'JDK25' profile in `gson/pom.xml` - extra-mvn-args: -Denforcer.fail=false --projects '!test-shrinker' + java-package: jdk+jmods runs-on: ubuntu-latest steps: @@ -42,10 +44,11 @@ jobs: with: persist-credentials: false - name: "Set up JDK ${{ matrix.java }}" - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 with: distribution: 'temurin' java-version: ${{ matrix.java }} + java-package: ${{ matrix.java-package }} cache: 'maven' - name: Build with Maven # This also runs javadoc:jar to detect any issues with the Javadoc generated during release @@ -60,7 +63,7 @@ jobs: with: persist-credentials: false - name: Set up JDK - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 with: distribution: 'temurin' java-version: 21 @@ -72,12 +75,7 @@ jobs: name: "GraalVM Native Image test (JDK ${{ matrix.java }})" strategy: matrix: - java: [ 21 ] - include: - - java: 25 - # Disable Enforcer check which (intentionally) prevents using JDK 25 for building - # TODO: Remove this once JDK 25 is fully supported for building Gson - extra-mvn-args: -Denforcer.fail=false + java: [ 21, 25 ] runs-on: ubuntu-latest steps: @@ -106,7 +104,7 @@ jobs: with: persist-credentials: false - name: Set up JDK - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 with: distribution: 'temurin' java-version: 17 diff --git a/.github/workflows/check-android-compatibility.yml b/.github/workflows/check-android-compatibility.yml index a3f02ab6a6..d650ac7541 100644 --- a/.github/workflows/check-android-compatibility.yml +++ b/.github/workflows/check-android-compatibility.yml @@ -29,7 +29,7 @@ jobs: persist-credentials: false - name: Set up JDK - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 with: distribution: 'temurin' java-version: '17' diff --git a/.github/workflows/check-api-compatibility.yml b/.github/workflows/check-api-compatibility.yml index 6c10ddec71..708194bb14 100644 --- a/.github/workflows/check-api-compatibility.yml +++ b/.github/workflows/check-api-compatibility.yml @@ -32,7 +32,7 @@ jobs: persist-credentials: false - name: Set up JDK - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 with: distribution: 'temurin' java-version: '17' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 90e1143f6a..b310b14385 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -43,7 +43,7 @@ jobs: - name: Set up JDK if: ${{ matrix.language == 'java' }} - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 + uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 with: distribution: 'temurin' java-version: '17' diff --git a/README.md b/README.md index 55ed4c8a99..6499af807f 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Gson uses Maven to build the project: mvn clean verify ``` -JDK 17 or newer is required for building, JDK 21 is recommended. Newer JDKs are currently not supported for building (but are supported when _using_ Gson). +JDK 17 or newer is required for building, JDK 21 is recommended. JDK 25 is supported, but only runs a subset of all tests if JDK `jmod` files are missing. Newer JDKs are currently not supported for building (but are supported when _using_ Gson). ### Contributing diff --git a/gson/pom.xml b/gson/pom.xml index 582fc200d8..af323b9769 100644 --- a/gson/pom.xml +++ b/gson/pom.xml @@ -353,8 +353,9 @@ + - JDK17 + JDK17-test [17,) @@ -363,14 +364,19 @@ - - + + + - JDK25 + JDK25-proguard [25,) + + ${java.home}/jmods/java.base.jmod + + com/google/gson/functional/EnumWithObfuscatedTest.java diff --git a/pom.xml b/pom.xml index 8e40596ffb..a983d5ce4f 100644 --- a/pom.xml +++ b/pom.xml @@ -120,7 +120,7 @@ - [17,22) + [17,26) @@ -561,6 +561,7 @@ + disable-error-prone diff --git a/test-graal-native-image/pom.xml b/test-graal-native-image/pom.xml index 0a3b679612..7271f9ec1d 100644 --- a/test-graal-native-image/pom.xml +++ b/test-graal-native-image/pom.xml @@ -116,8 +116,9 @@ + - JDK17 + JDK17-test [17,) diff --git a/test-shrinker/pom.xml b/test-shrinker/pom.xml index 611179162c..f6bdca175c 100644 --- a/test-shrinker/pom.xml +++ b/test-shrinker/pom.xml @@ -210,4 +210,37 @@ + + + + + + JDK25-proguard + + [25,) + + ${java.home}/jmods/java.base.jmod + + + + + + com.github.wvengen + proguard-maven-plugin + + true + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + true + + + + + +