You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2026/04/01 10:28:13 UTC

[PR] [improve][build] Support building and testing with Java 25 [pulsar]

lhotari opened a new pull request, #25453:
URL: https://github.com/apache/pulsar/pull/25453

   ### Motivation
   
   Java 25 (early access) support is needed to ensure Pulsar stays compatible with upcoming JDK releases. This PR adds the build infrastructure to build with Java 25 and run tests on different JDK versions (17, 21, 25).
   
   ### Modifications
   
   - **Java version enforcement**: Require Java 21 or 25 to build Pulsar (configurable in `settings.gradle.kts`, skippable with `-PskipJavaVersionCheck`)
   - **Test JDK selection**: Add `-PtestJavaVersion=<version>` Gradle property to run tests on a specific JDK using Gradle's Java Toolchain API (configuration cache compatible)
   - **Docker image JDK override**: Add `-PdockerJavaVersion=<version>` to override the JDK version used in Docker test images, with version catalog override support in `settings.gradle.kts`
   - **CI matrix updates**: Update `pulsar-ci.yaml` to use Java 25 for scheduled builds, pass `-PtestJavaVersion` to integration test runs, and properly set up multiple JDK versions when `runtime_jdk` differs from the build JDK
   - **Java 25 incompatibilities**: Disable `tiered-storage-file-system` tests on Java 25 (Hadoop MiniDFSCluster depends on Jetty 9 which is incompatible with Java 25)
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   This change is already covered by existing tests. The build infrastructure changes were verified by running `./gradlew assemble` and `./gradlew assemble -PdockerJavaVersion=25` successfully.
   
   ### Does this pull request potentially affect one of the following parts:
   
   - [x] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   
   ### Documentation
   
   - [x] `doc-not-needed`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][build] Support building and testing with Java 25 [pulsar]

Posted by "Denovo1998 (via GitHub)" <gi...@apache.org>.
Denovo1998 commented on code in PR #25453:
URL: https://github.com/apache/pulsar/pull/25453#discussion_r3021662668


##########
.github/workflows/pulsar-ci.yaml:
##########
@@ -534,11 +532,13 @@ jobs:
         with:
           limit-access-to-actor: true
 
-      - name: Set up JDK ${{ env.CI_JDK_MAJOR_VERSION }}
+      - name: Set up JDK ${{ env.CI_JDK_MAJOR_VERSION }}${{ matrix.runtime_jdk && matrix.runtime_jdk != env.CI_JDK_MAJOR_VERSION && format(' and {0}', matrix.runtime_jdk) || '' }}
         uses: actions/setup-java@v5
         with:
           distribution: ${{ env.JDK_DISTRIBUTION }}
-          java-version: ${{ env.CI_JDK_MAJOR_VERSION }}
+          java-version: >-
+            ${{ matrix.runtime_jdk != env.CI_JDK_MAJOR_VERSION && matrix.runtime_jdk || '' }}
+            ${{ env.CI_JDK_MAJOR_VERSION }}

Review Comment:
   This uses a folded scalar (`>-`) for `java-version`, but `actions/setup-java@v5` parses multiple JDKs with `getMultilineInput` and documents the multiline form with `|`. With `>-`, YAML folds the value into a single string like `17 21` instead of two versions, so this step won't actually install two JDKs. Maybe should switch this to a literal block (`|`) or use two explicit `setup-java` steps.
   



##########
tiered-storage/file-system/build.gradle.kts:
##########
@@ -81,3 +81,12 @@ dependencies {
     testImplementation("org.eclipse.jetty:jetty-servlet:9.4.58.v20250814")
     testImplementation("org.eclipse.jetty:jetty-util:9.4.58.v20250814")
 }
+
+// Hadoop 3.4.x is incompatible with Java 25

Review Comment:
   This disables every test in `tiered-storage/file-system` on Java 25, but `FileSystemOffloaderLocalFileTest` is a local-file test and does not use `MiniDFSCluster` / the Jetty 9-based HDFS test setup. Could we narrow this skip to the HDFS/MiniDFS-based tests instead of dropping all test coverage for the module on Java 25?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][build] Support building and testing with Java 25 [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #25453:
URL: https://github.com/apache/pulsar/pull/25453#issuecomment-4170376079

   /pulsarbot rerun-failure-checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][build] Support building and testing with Java 25 [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #25453:
URL: https://github.com/apache/pulsar/pull/25453#discussion_r3021702884


##########
tiered-storage/file-system/build.gradle.kts:
##########
@@ -81,3 +81,12 @@ dependencies {
     testImplementation("org.eclipse.jetty:jetty-servlet:9.4.58.v20250814")
     testImplementation("org.eclipse.jetty:jetty-util:9.4.58.v20250814")
 }
+
+// Hadoop 3.4.x is incompatible with Java 25

Review Comment:
   The file-system uses Hadoop 3.4.x which isn't compatible with Java 25. It's better to just disable for now. Hadoop 3.5.x will soon be available with Java 25 support.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][build] Support building and testing with Java 25 [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #25453:
URL: https://github.com/apache/pulsar/pull/25453#discussion_r3021708979


##########
.github/workflows/pulsar-ci.yaml:
##########
@@ -534,11 +532,13 @@ jobs:
         with:
           limit-access-to-actor: true
 
-      - name: Set up JDK ${{ env.CI_JDK_MAJOR_VERSION }}
+      - name: Set up JDK ${{ env.CI_JDK_MAJOR_VERSION }}${{ matrix.runtime_jdk && matrix.runtime_jdk != env.CI_JDK_MAJOR_VERSION && format(' and {0}', matrix.runtime_jdk) || '' }}
         uses: actions/setup-java@v5
         with:
           distribution: ${{ env.JDK_DISTRIBUTION }}
-          java-version: ${{ env.CI_JDK_MAJOR_VERSION }}
+          java-version: >-
+            ${{ matrix.runtime_jdk != env.CI_JDK_MAJOR_VERSION && matrix.runtime_jdk || '' }}
+            ${{ env.CI_JDK_MAJOR_VERSION }}

Review Comment:
   thanks, fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][build] Support building and testing with Java 25 [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat merged PR #25453:
URL: https://github.com/apache/pulsar/pull/25453


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org