[pip] PIP-472: Migrate from javax.* to jakarta.* APIs#25700
Open
lhotari wants to merge 2 commits intoapache:masterfrom
Open
[pip] PIP-472: Migrate from javax.* to jakarta.* APIs#25700lhotari wants to merge 2 commits intoapache:masterfrom
lhotari wants to merge 2 commits intoapache:masterfrom
Conversation
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
I'd like to propose PIP-472, which migrates Apache Pulsar's source code
and dependencies from the legacy
javax.*namespace (Jakarta EE 8 andearlier) to the modern
jakarta.*namespace (Jakarta EE 9+).In 2017 Oracle transferred Java EE to the Eclipse Foundation, and from
Jakarta EE 9 onward (released 2020) every Jakarta EE specification
moved its package prefix from
javax.*tojakarta.*. The twonamespaces are source- and binary-incompatible. The upstream ecosystem
has fully moved on: Jersey 3.x, Jetty 11+, Swagger Core 2.x, Spring 6,
Hibernate Validator 7+, and MicroProfile 5+ all require
jakarta.*.Pulsar cannot pick up upstream bug fixes, performance improvements, or
security advisories without leaving the
javax.*namespace.Pulsar's codebase still imports
javax.*from approximately 1,620Java files (660
javax.ws.rs, 368javax.servlet, 48javax.annotation, plus JDK packages that stay injavax.*permanently and are out of scope). A partial migration is visible in
git history and PR #23905 is in flight, but the Jakarta-named API
artifacts in
gradle/libs.versions.tomlare still pinned to JakartaEE 8 versions that emit the
javax.*namespace, and Jetty 12 isconfigured with its
ee8-*(javax-servlet compat) modules. The resultis a half-migrated state that is harder to reason about and extend
than either endpoint.
PIP-472 consolidates the migration into a coordinated, four-phase
plan: a preparation phase (OpenRewrite tooling and Checkstyle import
checks), a Phase 1 that atomically migrates the broker REST tier
(Jersey 2.42 → 3.1.10, Swagger 1.6.2 → 2.2.27,
jetty-ee10-*addedalongside the retained
jetty-ee8-*, Jakarta EE 10 API versions),a Phase 2 that mechanically sweeps non-REST
javax.*imports moduleby module, and a Phase 3 cleanup of shading rules, LICENSE/NOTICE
files, and a migration guide.
The plan keeps existing
AdditionalServletplugins working withoutrecompilation by retaining the Jetty 12 ee8 environment alongside
ee10 and extending the
AdditionalServletSPI so plugins canregister
jakarta.servlethandlers (preferred, routed to ee10) inaddition to
javax.servlethandlers (legacy, routed to ee8).Connectors and Functions running in NAR-isolated classloaders are
unaffected. The wire protocol and REST API are unchanged. Plugin
authors that contribute JAX-RS resources to the broker REST tier and
embedding consumers of
pulsar-client-adminneed to update theirjavax.*imports tojakarta.*and recompile.The benefits include unblocking dependency upgrades (Jersey 3, Jetty
ee10, Swagger 2), eliminating Pulsar's direct dependency on
javax.servlet:javax.servlet-api:3.1.0, ending the half-migratedclasspath, and aligning Pulsar 5.0 LTS with the modern Jakarta EE
ecosystem before the LTS branch is cut.
The full proposal can be found at: #25700
Rendered PIP document:
https://github.com/lhotari/pulsar/blob/lh-pip-472/pip/pip-472.md
I welcome your feedback and discussion on this proposal. Please share
your thoughts, concerns, or suggestions.
Mailing list discussion: https://lists.apache.org/thread/1crbw2y2zg89qsyyq7qnv3ldh640lpsy