Skip to content

Commit

Permalink
Support for building with OpenJDK 21
Browse files Browse the repository at this point in the history
  • Loading branch information
linghengqian committed Sep 20, 2023
1 parent 41d9f0c commit c07357b
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions agent/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
Expand Down
9 changes: 0 additions & 9 deletions agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,8 @@
<module>plugins</module>
</modules>

<properties>
<bytebuddy.version>1.14.4</bytebuddy.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${bytebuddy.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-test-util</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 的要求安装本地工具链。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
42 changes: 31 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<transmittable-thread-local.version>2.14.2</transmittable-thread-local.version>

<antlr4.version>4.10.1</antlr4.version>
<bytebuddy.version>1.14.8</bytebuddy.version>
<snakeyaml.version>1.33</snakeyaml.version>
<gson.version>2.9.1</gson.version>
<jackson.version>2.14.0</jackson.version>
Expand Down Expand Up @@ -102,7 +103,7 @@
<slf4j.version>1.7.36</slf4j.version>
<logback.version>1.2.11</logback.version>

<lombok.version>1.18.20</lombok.version>
<lombok.version>1.18.30</lombok.version>

<postgresql.version>42.4.1</postgresql.version>
<opengauss.version>3.1.0-og</opengauss.version>
Expand All @@ -128,15 +129,15 @@
<dockerfile-maven.version>1.4.13</dockerfile-maven.version>
<docker-compose-maven-plugin.version>4.0.0</docker-compose-maven-plugin.version>
<os-maven-plugin.version>1.6.2</os-maven-plugin.version>
<native-maven-plugin.version>0.9.24</native-maven-plugin.version>
<native-maven-plugin.version>0.9.27</native-maven-plugin.version>

<!-- Compile plugin versions -->
<maven-enforcer-plugin.version>3.2.1</maven-enforcer-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version>
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
<jandex-maven-plugin.version>3.0.5</jandex-maven-plugin.version>
<jandex-maven-plugin.version>3.1.3</jandex-maven-plugin.version>
<build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
<maven-dependency-plugin.version>3.5.0</maven-dependency-plugin.version>
<exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
Expand Down Expand Up @@ -571,20 +572,37 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${bytebuddy.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>${bytebuddy.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<artifactId>mockito-bom</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
<type>pom</type>
<scope>import</scope>
<exclusions>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</exclusion>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
Expand Down Expand Up @@ -674,14 +692,17 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -1235,7 +1256,6 @@
<excludes>
<exclude>org.apache.shardingsphere.agent.core.**</exclude>
</excludes>
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED</argLine>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit c07357b

Please sign in to comment.