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/09/29 21:02:21 UTC

[PR] [improve][build] Require Java 21 for servers while preserving Java 17 client compatibility [pulsar]

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

   ### Motivation
   
   Pulsar 5 server components should require Java 21 while client libraries remain usable on Java 17, as discussed on the [dev mailing list](https://lists.apache.org/thread/3zclb8cq0dt95c8f1lh83qxyyj11m8pq). Users must also be able to compile Functions and IO implementations against the public interfaces with Java 17, even though Pulsar's Functions runtime requires Java 21.
   
   ### Modifications
   
   - Default main sources and server startup to Java 21. Keep an explicit Java 17 dependency closure covering both client generations, admin/auth/crypto clients, TLS/HTTP SPIs, shared APIs, and Functions/IO interfaces.
   - Publish matching Gradle JVM attributes and reject incompatible dependencies. Check Java 17 class-file versions in dependencies and final shaded jars, respecting multi-release jar selection.
   - Keep the fastutil minimizer's Java 21 reachability inputs separate from its Java 17 published artifact.
   - Compile ordinary tests for Java 21 so client tests can use server fixtures. Add a dedicated consumer test compiled with `--release 17` and executed with Gradle's Java 17 toolchain launcher, plus CI setup and documentation.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   Passed locally on Gradle 9.8.0:
   
   - `./gradlew help assemble sanityCheck :tests:pulsar-java17-compatibility:test generateMetadataFileForMavenPublication -PtestRetryCount=0 --configuration-cache --warning-mode all`
   - `./gradlew -p build-logic :conventions:test --tests VerifyJavaCompatibilityTest`
   - Two Java 17 consumer tests and four bytecode-checker tests passed. `sanityCheck` includes Spotless, Checkstyle, and main/test compilation.
   - Inspected generated client, minimized/shaded client, Functions API, and broker JVM metadata.
   
   Full broker and cross-JVM interoperability tests were not run. The bytecode checker does not prove all third-party JDK API or reflective compatibility. Gradle reports deprecations for `Configuration.setVisible` and publication dependencies on unpublished projects; these are outside this change.
   
   ### Does this pull request potentially affect one of the following parts:
   
   - [ ] 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
   - [x] Anything that affects deployment
   
   Server components, CLI tools, and Functions runtime implementations now require Java 21 or later. Client libraries and Functions/IO public interfaces retain Java 17 compatibility.
   
   


-- 
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] Require Java 21 for servers while preserving Java 17 client compatibility [pulsar]

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


-- 
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