Skip to content

Commit bb43a3d

Browse files
committed
[SPARK-51953] Support Java 24
### What changes were proposed in this pull request? This PR aims to support Java 24 as a preparation of Java 25 LTS. - Update `lombok`, `jacoco`, and `mockito` libraries to support Java 24. - Disable `pmd` and `spotbugs` plugins. - Add `--enable-native-access=ALL-UNNAMED` to `DEFAULT_JVM_OPTS`. - Add `SPARK_USER=spark` environment to the operator pod explicitly. - Update `4.0.0-preview2` dependency to `4.0.1-SNAPSHOT` to validate with the upcoming `Apache Spark 4.0.0 RC5`. - Use `azul/zulu-openjdk:24-jre` as the docker base image. - Add `Java 24` to the CI. ### Why are the changes needed? To support Java 24 as a preparation of Java 25 LTS. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#178 from dongjoon-hyun/SPARK-51953. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 50b31f4 commit bb43a3d

File tree

6 files changed

+28
-21
lines changed

6 files changed

+28
-21
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
fail-fast: false
3434
matrix:
3535
os: [ 'ubuntu-latest', 'ubuntu-24.04-arm' ]
36-
java-version: [ 17, 21 ]
36+
java-version: [ 17, 21, 24 ]
3737
steps:
3838
- name: Checkout repository
3939
uses: actions/checkout@v3

build-tools/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ COPY . .
2222

2323
RUN --mount=type=cache,target=/home/gradle/.gradle/caches gradle --no-daemon clean build -x check
2424

25-
FROM azul/zulu-openjdk:21-jre
25+
FROM azul/zulu-openjdk:24-jre
2626

2727
ARG APP_VERSION=0.1.0-SNAPSHOT
2828
ARG SPARK_UID=185

build-tools/helm/spark-kubernetes-operator/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ operatorDeployment:
4343
operatorContainer:
4444
jvmArgs: "-Dfile.encoding=UTF8"
4545
env:
46+
- name: "SPARK_USER"
47+
value: "spark"
4648
envFrom:
4749
volumeMounts: { }
4850
resources:

build.gradle

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ subprojects {
5858

5959
repositories {
6060
mavenCentral()
61+
maven {
62+
url = "https://repository.apache.org/content/repositories/snapshots/"
63+
}
6164
}
6265

6366
apply plugin: 'checkstyle'
@@ -68,22 +71,24 @@ subprojects {
6871
showViolations = true
6972
}
7073

71-
apply plugin: 'pmd'
72-
pmd {
73-
ruleSetFiles = files("$rootDir/config/pmd/ruleset.xml")
74-
toolVersion = libs.versions.pmd.get()
75-
consoleOutput = true
76-
ignoreFailures = false
77-
}
74+
if (JavaVersion.current() < JavaVersion.VERSION_24) {
75+
apply plugin: 'pmd'
76+
pmd {
77+
ruleSetFiles = files("$rootDir/config/pmd/ruleset.xml")
78+
toolVersion = libs.versions.pmd.get()
79+
consoleOutput = true
80+
ignoreFailures = false
81+
}
7882

79-
apply plugin: 'com.github.spotbugs'
80-
spotbugs {
81-
toolVersion = libs.versions.spotbugs.tool.get()
82-
afterEvaluate {
83-
reportsDir = file("${project.reporting.baseDir}/findbugs")
83+
apply plugin: 'com.github.spotbugs'
84+
spotbugs {
85+
toolVersion = libs.versions.spotbugs.tool.get()
86+
afterEvaluate {
87+
reportsDir = file("${project.reporting.baseDir}/findbugs")
88+
}
89+
excludeFilter = file("$rootDir/config/spotbugs/spotbugs_exclude.xml")
90+
ignoreFailures = false
8491
}
85-
excludeFilter = file("$rootDir/config/spotbugs/spotbugs_exclude.xml")
86-
ignoreFailures = false
8792
}
8893

8994
apply plugin: 'jacoco'

gradle/libs.versions.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
# under the License.
1717
[versions]
1818
fabric8 = "7.1.0"
19-
lombok = "1.18.32"
19+
lombok = "1.18.38"
2020
operator-sdk = "4.9.0"
2121
okhttp = "4.12.0"
2222
dropwizard-metrics = "4.2.25"
23-
spark = "4.0.0-preview2"
23+
spark = "4.0.1-SNAPSHOT"
2424
log4j = "2.24.2"
2525

2626
# Test
2727
junit = "5.10.2"
28-
jacoco = "0.8.12"
29-
mockito = "5.11.0"
28+
jacoco = "0.8.13"
29+
mockito = "5.17.0"
3030
powermock = "2.0.9"
3131

3232
# Build Analysis

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ fi
210210

211211

212212
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
213-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
213+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m" "--enable-native-access=ALL-UNNAMED"'
214214

215215
# Collect all arguments for the java command:
216216
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,

0 commit comments

Comments
 (0)