Fix #21506: Upgrade to Java 21 (#21507)

* Fix #21506: Upgrade to Java 21

* Fix #1655: Upgrade to Java 21
This commit is contained in:
Sriharsha Chintalapani 2025-06-11 22:06:08 -07:00 committed by GitHub
parent fcd0c4114f
commit 8bb055fc9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 37 additions and 42 deletions

View File

@ -30,11 +30,11 @@ runs:
sudo apt-get update sudo apt-get update
sudo apt-get install -y unixodbc-dev python3-venv librdkafka-dev gcc libsasl2-dev build-essential libssl-dev libffi-dev \ sudo apt-get install -y unixodbc-dev python3-venv librdkafka-dev gcc libsasl2-dev build-essential libssl-dev libffi-dev \
librdkafka-dev unixodbc-dev libevent-dev wkhtmltopdf libkrb5-dev jq librdkafka-dev unixodbc-dev libevent-dev wkhtmltopdf libkrb5-dev jq
- name: Set up JDK 17 - name: Set up JDK 21
if: inputs.is_ingestion == 'false' if: inputs.is_ingestion == 'false'
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: 17 java-version: 21
distribution: 'temurin' distribution: 'temurin'
- name: Install antlr cli - name: Install antlr cli

View File

@ -26,10 +26,10 @@ runs:
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# ---- Setup Java -------------------------------------------------------------- # ---- Setup Java --------------------------------------------------------------
- name: Setup JDK 17 - name: Setup JDK 21
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: '17' java-version: '21'
distribution: 'temurin' distribution: 'temurin'
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------

View File

@ -62,10 +62,10 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }} ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 fetch-depth: 0
- name: Set up JDK 17 - name: Set up JDK 21
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: '17' java-version: '21'
distribution: 'temurin' distribution: 'temurin'
- name: Set up Python 3.10 - name: Set up Python 3.10

View File

@ -27,10 +27,10 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up JDK 17 - name: Set up JDK 21
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: 17 java-version: 21
distribution: 'temurin' distribution: 'temurin'
- name: Install antlr cli - name: Install antlr cli

View File

@ -67,10 +67,10 @@ jobs:
with: with:
ref: ${{ github.event.pull_request.head.sha }} ref: ${{ github.event.pull_request.head.sha }}
- name: Set up JDK 17 - name: Set up JDK 21
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: '17' java-version: '21'
distribution: 'temurin' distribution: 'temurin'
- name: Run checkstyle - name: Run checkstyle

View File

@ -84,11 +84,11 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-maven- ${{ runner.os }}-maven-
- name: Set up JDK 17 - name: Set up JDK 21
if: steps.cache-output.outputs.exit-code == 0 if: steps.cache-output.outputs.exit-code == 0
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: '17' java-version: '21'
distribution: 'temurin' distribution: 'temurin'
- name: Install Ubuntu dependencies - name: Install Ubuntu dependencies

View File

@ -83,11 +83,11 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-maven- ${{ runner.os }}-maven-
- name: Set up JDK 17 - name: Set up JDK 21
if: steps.cache-output.outputs.exit-code == 0 if: steps.cache-output.outputs.exit-code == 0
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: '17' java-version: '21'
distribution: 'temurin' distribution: 'temurin'
- name: Install Ubuntu dependencies - name: Install Ubuntu dependencies

View File

@ -70,11 +70,11 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-maven- ${{ runner.os }}-maven-
- name: Set up JDK 17 - name: Set up JDK 21
if: steps.cache-output.outputs.exit-code == 0 if: steps.cache-output.outputs.exit-code == 0
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: "17" java-version: "21"
distribution: "temurin" distribution: "temurin"
- name: Install Ubuntu dependencies - name: Install Ubuntu dependencies

View File

@ -43,10 +43,10 @@ jobs:
swap-storage: true swap-storage: true
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up JDK 17 - name: Set up JDK 21
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: 17 java-version: 21
distribution: "temurin" distribution: "temurin"
server-id: ossrh server-id: ossrh
server-username: MAVEN_USERNAME server-username: MAVEN_USERNAME

View File

@ -31,10 +31,10 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install -y libkrb5-dev build-essential sudo apt-get install -y libkrb5-dev build-essential
- name: Setup JDK 17 - name: Setup JDK 21
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: '17' java-version: '21'
distribution: 'temurin' distribution: 'temurin'
- name: Generate Python Data Models - name: Generate Python Data Models

View File

@ -41,10 +41,10 @@ jobs:
with: with:
python-version: 3.9 python-version: 3.9
- name: Set up JDK 17 - name: Set up JDK 21
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: '17' java-version: '21'
distribution: 'temurin' distribution: 'temurin'
- name: Install Ubuntu dependencies - name: Install Ubuntu dependencies

View File

@ -46,10 +46,10 @@ jobs:
docker-images: true docker-images: true
swap-storage: true swap-storage: true
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up JDK 17 - name: Set up JDK 21
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: '17' java-version: '21'
distribution: 'temurin' distribution: 'temurin'
- name: Generating Data Models - name: Generating Data Models

View File

@ -96,21 +96,16 @@ if [ "x$OPENMETADATA_DEBUG" != "x" ]; then
OPENMETADATA_OPTS="$JAVA_DEBUG_OPTS $OPENMETADATA_OPTS" OPENMETADATA_OPTS="$JAVA_DEBUG_OPTS $OPENMETADATA_OPTS"
fi fi
# GC options # GC options for Java 21
GC_LOG_FILE_NAME='openmetadata-gc.log' GC_LOG_FILE_NAME='openmetadata-gc.log'
if [ -z "$OPENMETADATA_GC_LOG_OPTS" ]; then if [ -z "$OPENMETADATA_GC_LOG_OPTS" ]; then
JAVA_MAJOR_VERSION=$($JAVA -version 2>&1 | sed -E -n 's/.* version "([0-9]*).*$/\1/p') OPENMETADATA_GC_LOG_OPTS="-Xlog:gc*,gc+heap=info,gc+ergo=debug:file=$LOG_DIR/$GC_LOG_FILE_NAME:time,level,tags:filecount=10,filesize=102400"
if [[ "$JAVA_MAJOR_VERSION" -ge "9" ]] ; then
OPENMETADATA_GC_LOG_OPTS="-Xlog:gc*:file=$LOG_DIR/$GC_LOG_FILE_NAME:time,tags:filecount=10,filesize=102400"
else
OPENMETADATA_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
fi
fi fi
# JVM performance options # JVM performance options optimized for Java 21
if [ -z "$OPENMETADATA_JVM_PERFORMANCE_OPTS" ]; then if [ -z "$OPENMETADATA_JVM_PERFORMANCE_OPTS" ]; then
OPENMETADATA_JVM_PERFORMANCE_OPTS="-server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.headless=true" OPENMETADATA_JVM_PERFORMANCE_OPTS="-server -XX:+UseG1GC -XX:+UseStringDeduplication -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -XX:+UseLargePages -XX:+OptimizeStringConcat -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -Djava.awt.headless=true"
fi fi
#Application classname #Application classname

View File

@ -26,7 +26,7 @@ EXPOSE 8585
RUN adduser -D openmetadata && \ RUN adduser -D openmetadata && \
apk update && \ apk update && \
apk upgrade && \ apk upgrade && \
apk add --update --no-cache bash openjdk17-jre apk add --update --no-cache bash openjdk21-jre
COPY --chown=openmetadata:openmetadata --from=build /opt/openmetadata /opt/openmetadata COPY --chown=openmetadata:openmetadata --from=build /opt/openmetadata /opt/openmetadata
COPY --chmod=755 docker/openmetadata-start.sh / COPY --chmod=755 docker/openmetadata-start.sh /

View File

@ -37,7 +37,7 @@ LABEL org.open-metadata.commit-id=$COMMIT_ID
EXPOSE 8585 8586 EXPOSE 8585 8586
RUN adduser -D openmetadata && apk update && \ RUN adduser -D openmetadata && apk update && \
apk upgrade && \ apk upgrade && \
apk add --update --no-cache bash openjdk17-jre apk add --update --no-cache bash openjdk21-jre
COPY --chown=openmetadata:openmetadata --from=build /opt/openmetadata /opt/openmetadata COPY --chown=openmetadata:openmetadata --from=build /opt/openmetadata /opt/openmetadata
COPY --chmod=755 docker/openmetadata-start.sh ./ COPY --chmod=755 docker/openmetadata-start.sh ./

View File

@ -11,7 +11,7 @@
<artifactId>openmetadata-java-client</artifactId> <artifactId>openmetadata-java-client</artifactId>
<properties> <properties>
<java.version>17</java.version> <java.version>21</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<springfox-version>2.7.0</springfox-version> <springfox-version>2.7.0</springfox-version>

View File

@ -15,8 +15,8 @@
<module>openmetadata-java-client</module> <module>openmetadata-java-client</module>
</modules> </modules>
<properties> <properties>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>21</maven.compiler.target>
</properties> </properties>
<profiles> <profiles>

View File

@ -12,8 +12,8 @@
<artifactId>openmetadata-spec</artifactId> <artifactId>openmetadata-spec</artifactId>
<properties> <properties>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>21</maven.compiler.target>
<dropwizard.swagger.version>2.0.12-1</dropwizard.swagger.version> <dropwizard.swagger.version>2.0.12-1</dropwizard.swagger.version>
<maven-javadoc-plugin.version>3.6.0</maven-javadoc-plugin.version> <maven-javadoc-plugin.version>3.6.0</maven-javadoc-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version> <maven-source-plugin.version>3.3.1</maven-source-plugin.version>

View File

@ -915,8 +915,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version> <version>3.13.0</version>
<configuration> <configuration>
<source>17</source> <source>21</source>
<target>17</target> <target>21</target>
<annotationProcessorPaths> <annotationProcessorPaths>
<path> <path>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>