feat(jakarta): Migrate remaining javax APIs to Jakarta namespace#2476
Open
jbonofre wants to merge 20 commits intoapache:mainfrom
Open
feat(jakarta): Migrate remaining javax APIs to Jakarta namespace#2476jbonofre wants to merge 20 commits intoapache:mainfrom
jbonofre wants to merge 20 commits intoapache:mainfrom
Conversation
Complete the javax to jakarta migration started with the Pax Web 11.0.1 upgrade (servlet APIs). This migrates all remaining javax EE packages: - javax.annotation-api 1.3.2 -> jakarta.annotation-api 2.1.1 - javax.inject -> jakarta.inject-api 2.0.1 - javax.enterprise/cdi-api 1.2 -> jakarta.enterprise.cdi-api 4.0.1 - javax.ws.rs-api 2.1.1 -> jakarta.ws.rs-api 3.1.0 - javax.persistence-api 2.2 -> jakarta.persistence-api 3.1.0 - javax.transaction-api 1.2 -> jakarta.transaction-api 2.0.1 - javax.interceptor-api 1.2.2 -> jakarta.interceptor-api 2.1.0 - javax.jms-api 2.0.1 -> jakarta.jms-api 3.1.0 - javax.mail 1.4.7 -> com.sun.mail/jakarta.mail 1.6.7 - javax.websocket-api 1.1 -> jakarta.websocket-api 2.1.1 Updates Java imports, POM dependencies, feature descriptors, Import-Package headers, and test resources across core modules, examples, and integration tests.
Maven 3.x provides javax.inject via Sisu/Plexus for plugin DI. Migrating these to jakarta.inject breaks compilation since Maven 3 does not recognize Jakarta inject annotations.
The maven core bundle embeds javax.inject via shaded dependencies. The Import-Package exclusion must remain !javax.inject* to prevent an unresolvable OSGi requirement during feature verification.
…i feature CDI 4.0.1 (Jakarta EE 10) introduces CDI Lite which requires jakarta.enterprise.lang.model, unavailable in the feature resolution. CDI 3.0.1 (Jakarta EE 9.1) provides the jakarta namespace without the lang.model dependency.
Hibernate 5.x uses javax.persistence, incompatible with the Jakarta migration. Hibernate 6.x uses jakarta.persistence natively. - Update hibernate.version to 6.6.18.Final - Change groupId from org.hibernate to org.hibernate.orm - Remove hibernate-osgi bundle (dropped in 6.x, OSGi metadata now embedded in hibernate-core) - Update hibernate-commons-annotations to 7.0.3.Final
fpapon
approved these changes
Mar 23, 2026
Member
Author
|
@fpapon I'm still working on it (updating Hibernate, etc) to have the services clean. |
…gi references Hibernate 6 dropped the separate hibernate-osgi module as OSGi metadata is now embedded directly in hibernate-core. Update the enterprise feature to align with Hibernate 6.6.18 transitive dependencies: - Replace org.hibernate:hibernate-osgi with org.hibernate.orm:hibernate-core in pom - Switch from ANTLR 2 to ANTLR 4 runtime (antlr4-runtime 4.13.0) - Remove javassist (no longer used by Hibernate 6) - Update byte-buddy to 1.15.11 and jboss-logging to 3.5.0 - Replace org.jboss:jandex with io.smallrye:jandex 3.2.0 - Remove dom4j (no longer a Hibernate 6 dependency) - Wrap hibernate-commons-annotations (broken OSGi metadata in 7.0.3) - Update feature repo URLs from defunct hibernate-osgi to enterprise features - Update JPA example hibernate version range from [5,6) to [6,7)
- Update transaction-api version range from [1.1,2) to [2.0,3) to match new 2.0.0 feature version - Upgrade EclipseLink from 2.7.15 to 4.0.8 and remove obsolete antlr bundle - Remove Aries JPA EclipseLink adapter (incompatible with EclipseLink 4.x) - Upgrade Hibernate from 6.6.18 to 6.6.45.Final - Update byte-buddy to 1.17.5 to match Hibernate 6.6.45 dependencies - Use hibernate-commons-annotations 5.1.2.Final (proper OSGi manifest)
…ution Hibernate ORM 6.6.45 has mandatory Import-Package on Jackson core, databind, and dataformat-xml packages. Add jackson feature dependency and jackson-dataformat-xml bundle (with woodstox transitive deps) to the hibernate feature. Exclude hibernate/hibernate-envers from feature verification as Hibernate 6.6.x also has mandatory imports for vendor-specific packages (com.ibm.websphere, oracle.jdbc, org.objectweb.jonas_tm, org.postgresql.util, org.checkerframework) that cannot be provided in a generic OSGi environment.
…PA 3.2 - Upgrade hibernate.version from 6.6.45.Final to 7.3.0.Final - Upgrade Jakarta Persistence API from 3.1.0 to 3.2.0 - Upgrade Jakarta CDI API from 3.0.1 to 4.1.0 (required by Hibernate 7) - Add jakarta.enterprise.lang-model 4.1.0 (new CDI 4.1 dependency) - Upgrade Jakarta Interceptor API from 2.1.0 to 2.2.0 (required by CDI 4.1) - Add JSON-B API 3.0.1, JSON-P API 2.1.3, Yasson 3.0.4, Parsson 1.1.7 - Remove hibernate-commons-annotations (merged into hibernate-core in Hibernate 7) - Remove hibernate feature verification exclusion (no longer needed) - Update JPA example hibernate version range from [6,7) to [7,8)
…0 OSGi resolution Hibernate ORM 7.3.0.Final requires jakarta.validation [3.1.0, 4.0.0) as an OSGi Import-Package. Add the bundle to the hibernate feature and bump the version in hibernate-validator from 3.0.0 to 3.1.0.
….3.0 Add missing bundles and wrap overrides for Hibernate ORM 7.3.0.Final: - jakarta.xml.bind-api 4.0.2 and jakarta.activation-api 2.1.3 - hibernate-models 1.1.0 (wrapped, new Hibernate 7.x dependency) - Bump byte-buddy from 1.17.5 to 1.18.0 - Mark oracle.*, org.postgresql.*, tools.jackson.* as optional imports
…terceptor tests The E2ETest uses jakarta.inject.Inject but the test dependency was still the old geronimo-atinject_1.0_spec (javax.inject). Replace with jakarta.inject-api 2.0.1.
Remove dependency on org.apache.aries.jpa.api (which pulls in javax.persistence transitively) and use direct EntityManagerFactory injection via OSGi DS @reference instead of JpaTemplate.
Replace all remaining geronimo-atinject_1.0_spec (javax.inject) references with jakarta.inject-api 2.0.1 in itests/common, BOM, and karaf-itest-example.
Upgrade CXF to 4.1.2 (Jakarta EE compatible), add jakarta.activation-api, and update Jackson provider to jakarta.rs variant.
…a dependencies Migrate CXF client from javax to Jakarta namespace by upgrading cxf-rt-rs-client from 3.6.10 to 4.1.2, switching to jackson-jakarta-rs-json-provider, and adding jakarta.activation-api.
…tibility Pax Exam's injection framework requires javax.inject, not jakarta.inject. The OSGi resolver cannot find the jakarta.inject package in the Pax Exam test environment, causing itest failures.
…bility Pax Exam injects test dependencies using javax.inject, not jakarta.inject.
Test Results237 files ±0 237 suites ±0 23m 11s ⏱️ +28s For more details on these errors, see this check. Results for commit 5ee999e. ± Comparison against base commit e02d549. This pull request removes 3 and adds 3 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
DBCP2 2.8.0 imports javax.transaction (not jakarta.transaction), so it cannot resolve when the transaction-api feature provides jakarta.transaction-api/2.0.1. Update tests to assert resolution failure and align dependency versions with the current transaction-api feature.
Pax-JMS 1.1.3 still registers javax.jms.ConnectionFactory services. The Karaf JMS module was migrated to jakarta.jms.ConnectionFactory, causing a namespace mismatch where connection factories could not be discovered. Revert until pax-jms supports the Jakarta namespace.
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.
Summary
Dependency changes
javax.annotation:javax.annotation-api1.3.2jakarta.annotation:jakarta.annotation-apijavax.inject(geronimo-atinject)jakarta.inject:jakarta.inject-apijavax.enterprise:cdi-api1.2jakarta.enterprise:jakarta.enterprise.cdi-apijavax.ws.rs:javax.ws.rs-api2.1.1jakarta.ws.rs:jakarta.ws.rs-apijavax.persistence:javax.persistence-api2.2jakarta.persistence:jakarta.persistence-apijavax.transaction:javax.transaction-api1.2jakarta.transaction:jakarta.transaction-apijavax.interceptor:javax.interceptor-api1.2.2jakarta.interceptor:jakarta.interceptor-apijavax.jms:javax.jms-api2.0.1jakarta.jms:jakarta.jms-apijavax.mail:mail1.4.7com.sun.mail:jakarta.mailjavax.websocket:javax.websocket-api1.1jakarta.websocket:jakarta.websocket-apiModules affected
jms/,scheduler/,maven/core/,util/,bom/base,standard,enterprise,springkaraf-maven-pluginitests/common,itests/testTest plan
mvn clean install -DskipTestsmvn clean installon itests module