diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3bda2a7a..bc39b9fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,12 @@ jobs: strategy: matrix: java: [ 11, 17 ] + # Custom JDK 21 configuration + include: + - java: 21 + # Disable Enforcer check which (intentionally) prevents using JDK 21 for building + # Exclude 'shrinker-test' module because R8 does not support JDK 21 yet + extra-mvn-args: -Denforcer.fail=false --projects '!:shrinker-test' runs-on: ubuntu-latest steps: @@ -23,7 +29,7 @@ jobs: cache: 'maven' - name: Build with Maven # This also runs javadoc:jar to detect any issues with the Javadoc generated during release - run: mvn --batch-mode --no-transfer-progress verify javadoc:jar + run: mvn --batch-mode --no-transfer-progress verify javadoc:jar ${{ matrix.extra-mvn-args || '' }} native-image-test: name: "GraalVM Native Image test" diff --git a/gson/pom.xml b/gson/pom.xml index 527800d3..1799ef03 100644 --- a/gson/pom.xml +++ b/gson/pom.xml @@ -191,6 +191,19 @@ + + + + com.guardsquare + proguard-base + 7.4.1 + + + com.guardsquare + proguard-core + 9.1.0 + + true test-classes-obfuscated-injar diff --git a/gson/src/test/java/com/google/gson/functional/ReflectionAccessTest.java b/gson/src/test/java/com/google/gson/functional/ReflectionAccessTest.java index 165d671b..f7b2e335 100644 --- a/gson/src/test/java/com/google/gson/functional/ReflectionAccessTest.java +++ b/gson/src/test/java/com/google/gson/functional/ReflectionAccessTest.java @@ -18,6 +18,7 @@ package com.google.gson.functional; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.fail; +import static org.junit.Assume.assumeTrue; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -52,6 +53,9 @@ public class ReflectionAccessTest { @SuppressWarnings("removal") // java.lang.SecurityManager deprecation in Java 17 @Test public void testRestrictiveSecurityManager() throws Exception { + // Skip for newer Java versions where `System.setSecurityManager` is unsupported + assumeTrue(Runtime.version().feature() <= 17); + // Must use separate class loader, otherwise permission is not checked, see // Class.getDeclaredFields() Class clazz = loadClassWithDifferentClassLoader(ClassWithPrivateMembers.class); diff --git a/pom.xml b/pom.xml index 3e89ab58..0a9a82cd 100644 --- a/pom.xml +++ b/pom.xml @@ -463,6 +463,20 @@ + + + jdk21+ + + [21,) + + + + 8 + + + release diff --git a/proto/pom.xml b/proto/pom.xml index 75fffa9e..9d1cec26 100644 --- a/proto/pom.xml +++ b/proto/pom.xml @@ -31,6 +31,8 @@ 2023-01-01T00:00:00Z + + 3.25.1 @@ -50,7 +52,7 @@ com.google.protobuf protobuf-java - 4.0.0-rc-2 + ${protobufVersion} @@ -89,7 +91,7 @@ protobuf-maven-plugin 0.6.1 - com.google.protobuf:protoc:3.17.3:exe:${os.detected.classifier} + com.google.protobuf:protoc:${protobufVersion}:exe:${os.detected.classifier} diff --git a/shrinker-test/pom.xml b/shrinker-test/pom.xml index 468d88e6..c4bd4f26 100644 --- a/shrinker-test/pom.xml +++ b/shrinker-test/pom.xml @@ -104,6 +104,19 @@ + + + + com.guardsquare + proguard-base + 7.4.1 + + + com.guardsquare + proguard-core + 9.1.0 + + true ${project.basedir}/proguard.pro @@ -205,6 +218,7 @@ but it appears that can be ignored --> com.android.tools r8 + 8.1.72