From f2b8c4f47f253bb83c7959ffd2b7346e473c2788 Mon Sep 17 00:00:00 2001 From: Sam Gammon Date: Tue, 12 Mar 2024 13:23:28 -0700 Subject: [PATCH] Make build and tests work with Java 21, and enable CI for them. The main changes is that tests need `-Djava.security.manager=allow`. Fixes and closes https://github.com/google/guava/issues/7065 Helps with https://github.com/google/guava/issues/6790 Fixes https://github.com/google/guava/issues/6245 (at least the remaining parts that we actually care about) Fixes #7087 Signed-off-by: Sam Gammon RELNOTES=n/a PiperOrigin-RevId: 615151162 --- .github/workflows/ci.yml | 14 ++++++-------- android/pom.xml | 23 ++++++++++++++++++++++- pom.xml | 23 ++++++++++++++++++++++- 3 files changed, 50 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5453d3a1df3..0fc561fbcd75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,11 +20,11 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - java: [ 8, 11, 17 ] + java: [ 8, 11, 17, 21 ] root-pom: [ 'pom.xml', 'android/pom.xml' ] include: - os: windows-latest - java: 17 + java: 21 root-pom: pom.xml runs-on: ${{ matrix.os }} env: @@ -68,11 +68,10 @@ jobs: steps: - name: 'Check out repository' uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - name: 'Set up JDK 11' + - name: 'Set up JDK 21' uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0 - with: - java-version: 11 + java-version: 21 distribution: 'zulu' server-id: sonatype-nexus-snapshots server-username: CI_DEPLOY_USERNAME @@ -94,11 +93,10 @@ jobs: steps: - name: 'Check out repository' uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - name: 'Set up JDK 11' + - name: 'Set up JDK 21' uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0 - with: - java-version: 11 + java-version: 21 distribution: 'zulu' cache: 'maven' - name: 'Generate latest docs' diff --git a/android/pom.xml b/android/pom.xml index 9d59d6cca7ad..96ea9fa41df5 100644 --- a/android/pom.xml +++ b/android/pom.xml @@ -25,6 +25,7 @@ 2024-01-02T00:00:00Z UTF-8 + integration android android @@ -176,6 +177,13 @@ org.codehaus.mojo animal-sniffer-maven-plugin 1.23 + + + org.ow2.asm + asm + 9.6 + + com.google.common.base.IgnoreJRERequirement,com.google.common.collect.IgnoreJRERequirement,com.google.common.hash.IgnoreJRERequirement,com.google.common.io.IgnoreJRERequirement,com.google.common.reflect.IgnoreJRERequirement,com.google.common.testing.IgnoreJRERequirement true @@ -253,7 +261,7 @@ alphabetical - -Xmx1536M -Duser.language=hi -Duser.country=IN ${test.add.opens} + -Xmx1536M -Duser.language=hi -Duser.country=IN ${test.add.args} ${test.add.opens} @@ -462,5 +470,18 @@ + + javac-for-jvm18plus + + + [18,] + + + -Djava.security.manager=allow + + diff --git a/pom.xml b/pom.xml index dab7face2552..f92855fb4ef8 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,7 @@ 2024-01-02T00:00:00Z UTF-8 + integration standard-jvm jre @@ -177,6 +178,13 @@ org.codehaus.mojo animal-sniffer-maven-plugin 1.23 + + + org.ow2.asm + asm + 9.6 + + com.google.common.base.IgnoreJRERequirement,com.google.common.collect.IgnoreJRERequirement,com.google.common.hash.IgnoreJRERequirement,com.google.common.io.IgnoreJRERequirement,com.google.common.reflect.IgnoreJRERequirement,com.google.common.testing.IgnoreJRERequirement true @@ -248,7 +256,7 @@ alphabetical - -Xmx1536M -Duser.language=hi -Duser.country=IN ${test.add.opens} + -Xmx1536M -Duser.language=hi -Duser.country=IN ${test.add.args} ${test.add.opens} @@ -457,5 +465,18 @@ + + javac-for-jvm18plus + + + [18,] + + + -Djava.security.manager=allow + +