From c07357b3d5aa7aab796a2b598f212b9df6946cbd Mon Sep 17 00:00:00 2001 From: linghengqian Date: Thu, 31 Aug 2023 22:56:06 +0800 Subject: [PATCH] Support for building with OpenJDK 21 --- .github/workflows/nightly-build.yml | 2 +- .github/workflows/nightly-ci.yml | 2 +- agent/core/pom.xml | 1 + agent/pom.xml | 9 ---- .../startup/graalvm-native-image.cn.md | 6 +-- .../startup/graalvm-native-image.en.md | 6 +-- pom.xml | 42 ++++++++++++++----- 7 files changed, 40 insertions(+), 28 deletions(-) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 2d1883578eb56f..ef3cf3269053e0 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -119,7 +119,7 @@ jobs: ref: ${{ inputs.commit-id }} - uses: graalvm/setup-graalvm@v1 with: - java-version: '17.0.8' + java-version: '21' distribution: 'graalvm-community' github-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions/cache@v3 diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index 75a6b7a4e2f5df..ecb8f4921e7032 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -41,7 +41,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - java-version: [ 11, 17, 20 ] + java-version: [ 11, 21-ea ] steps: - name: Support Long Paths in Windows if: matrix.os == 'windows-latest' diff --git a/agent/core/pom.xml b/agent/core/pom.xml index 014a57a65ea3cd..79babf7258f891 100644 --- a/agent/core/pom.xml +++ b/agent/core/pom.xml @@ -52,6 +52,7 @@ net.bytebuddy byte-buddy + compile org.yaml diff --git a/agent/pom.xml b/agent/pom.xml index 7c8129d7bc470b..47cfdac6a0eebe 100644 --- a/agent/pom.xml +++ b/agent/pom.xml @@ -33,17 +33,8 @@ plugins - - 1.14.4 - - - - net.bytebuddy - byte-buddy - ${bytebuddy.version} - org.apache.shardingsphere shardingsphere-test-util diff --git a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md index 973e550be69112..ae974436db781d 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md @@ -49,13 +49,13 @@ services: ## 前提条件 -1. 根据 https://www.graalvm.org/downloads/ 要求安装和配置 JDK 17 对应的 `GraalVM Community Edition` 或 `Oracle GraalVM` +1. 根据 https://www.graalvm.org/downloads/ 要求安装和配置 JDK 21 对应的 `GraalVM Community Edition` 或 `Oracle GraalVM` 。或者使用 `SDKMAN!` 。如果你希望使用携带了 [GraalVM Free Terms and Conditions license](https://www.oracle.com/downloads/licenses/graal-free-license.html) - 的 `Oracle GraalVM`,下面的命令应更改为 `sdk install java 17.0.8-graal`。 + 的 `Oracle GraalVM`,下面的命令应更改为 `sdk install java 21-graal`。 ```shell -sdk install java 17.0.8-graalce +sdk install java 21-graalce ``` 2. 根据 https://www.graalvm.org/latest/reference-manual/native-image/#prerequisites 的要求安装本地工具链。 diff --git a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md index 993d9dcd482639..2ca48ace964a01 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md @@ -56,13 +56,13 @@ services: ## Premise -1. Install and configure `GraalVM Community Edition` or `Oracle GraalVM` for JDK 17 according +1. Install and configure `GraalVM Community Edition` or `Oracle GraalVM` for JDK 21 according to https://www.graalvm.org/downloads/. Or use `SDKMAN!`. If you wish to use `Oracle GraalVM` with [GraalVM Free Terms and Conditions license](https://www.oracle.com/downloads/licenses/graal-free-license.html), - the following command should be changed to `sdk install java 17.0.8-graal`. + the following command should be changed to `sdk install java 21-graal`. ```shell -sdk install java 17.0.8-graalce +sdk install java 21-graalce ``` 2. Install the local toolchain as required by https://www.graalvm.org/latest/reference-manual/native-image/#prerequisites. diff --git a/pom.xml b/pom.xml index aa743a7b073de9..0717b54cd13be3 100644 --- a/pom.xml +++ b/pom.xml @@ -72,6 +72,7 @@ 2.14.2 4.10.1 + 1.14.8 1.33 2.9.1 2.14.0 @@ -102,7 +103,7 @@ 1.7.36 1.2.11 - 1.18.20 + 1.18.30 42.4.1 3.1.0-og @@ -128,15 +129,15 @@ 1.4.13 4.0.0 1.6.2 - 0.9.24 + 0.9.27 3.2.1 3.11.0 3.3.1 - 3.0.0 + 3.1.2 3.3.0 - 3.0.5 + 3.1.3 3.3.0 3.5.0 3.1.0 @@ -571,20 +572,37 @@ test - org.mockito - mockito-core - ${mockito.version} + net.bytebuddy + byte-buddy + ${bytebuddy.version} + test + + + net.bytebuddy + byte-buddy-agent + ${bytebuddy.version} test org.mockito - mockito-inline + mockito-bom ${mockito.version} - test + pom + import + + + net.bytebuddy + byte-buddy + + + net.bytebuddy + byte-buddy-agent + + org.mockito - mockito-junit-jupiter + mockito-inline ${mockito.version} test @@ -674,14 +692,17 @@ org.mockito mockito-core + test org.mockito mockito-inline + test org.mockito mockito-junit-jupiter + test @@ -1235,7 +1256,6 @@ org.apache.shardingsphere.agent.core.** - --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED