feat(jakarta): Migrate library to Jakarta EE 9+ namespace#397
feat(jakarta): Migrate library to Jakarta EE 9+ namespace#397xausky wants to merge 1 commit intocdancy:masterfrom
Conversation
This commit upgrades all dependency artifacts and source code from the legacy javax.* namespace to the new jakarta.* namespace. This change is required to support modern application servers (e.g., Tomcat 10+, WildFly 26+, Jetty 11+). BREAKING CHANGE: All users integrating this library must now use Jakarta EE compatible environments and update their own source code to use the jakarta.* imports. Compatibility with old Java EE environments (e.g., Tomcat 9, WildFly 25) is dropped.
There was a problem hiding this comment.
Pull request overview
This PR performs a comprehensive migration from the legacy Java EE (javax.) namespace to the modern Jakarta EE 9+ (jakarta.) namespace. This breaking change enables compatibility with modern application servers like Tomcat 10+, WildFly 26+, and Jetty 11+ while dropping support for older Java EE environments.
Key Changes:
- Updated all source code from
javax.inject,javax.ws.rs, andjavax.annotationto theirjakarta.*equivalents - Upgraded dependencies: jclouds (2.5.0 → 2.7.0), Guice (5.1.0 → 7.0.0), and Jakarta API libraries
- Bumped major version to 2.0.0-jakarta to reflect the breaking nature of this change
- Updated shadow jar relocation rules to use jakarta namespace
Reviewed changes
Copilot reviewed 76 out of 77 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| build.gradle | Updated jclouds to 2.7.0, Guice to 7.0.0, and replaced javax dependencies with jakarta equivalents |
| gradle.properties | Bumped version from 1.0.2 to 2.0.0-jakarta |
| gradle/additional-artifacts.gradle | Updated shadow jar relocation rules from javax.* to jakarta.* namespaces |
| src/main/java/com/cdancy/jenkins/rest/features/*.java | Migrated JAX-RS and inject annotations from javax to jakarta namespace |
| src/main/java/com/cdancy/jenkins/rest/filters/*.java | Updated inject annotations to jakarta.inject |
| src/main/java/com/cdancy/jenkins/rest/parsers/*.java | Migrated singleton and HTTP headers imports to jakarta namespace |
| src/main/java/com/cdancy/jenkins/rest/binders/*.java | Updated inject imports to jakarta |
| src/main/java/com/cdancy/jenkins/rest/*.java | Reorganized imports and core API namespace updates |
| src/test/java/**/*.java | Updated test imports from javax to jakarta, reorganized import statements |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import jakarta.inject.Named; | ||
| import jakarta.ws.rs.*; | ||
| import jakarta.ws.rs.core.MediaType; | ||
| import org.jclouds.Fallbacks; | ||
| import org.jclouds.rest.annotations.*; |
There was a problem hiding this comment.
The wildcard imports (jakarta.ws.rs.* and org.jclouds.rest.annotations.*) should be expanded to explicit imports to maintain consistency with the rest of the codebase. Other API files in the same package use explicit imports (e.g., SystemApi, StatisticsApi, CrumbIssuerApi).
| import jakarta.inject.Named; | ||
| import jakarta.ws.rs.*; | ||
| import jakarta.ws.rs.core.MediaType; | ||
| import org.jclouds.Fallbacks; | ||
| import org.jclouds.javax.annotation.Nullable; | ||
| import org.jclouds.rest.annotations.*; |
There was a problem hiding this comment.
The wildcard imports (jakarta.ws.rs.* and org.jclouds.rest.annotations.*) should be expanded to explicit imports to maintain consistency with the rest of the codebase. Other API files in the same package use explicit imports (e.g., SystemApi, StatisticsApi, CrumbIssuerApi).
| import jakarta.inject.Named; | ||
| import jakarta.ws.rs.*; | ||
| import jakarta.ws.rs.core.MediaType; | ||
| import org.jclouds.javax.annotation.Nullable; | ||
| import org.jclouds.rest.annotations.Fallback; | ||
| import org.jclouds.rest.annotations.Payload; | ||
| import org.jclouds.rest.annotations.PayloadParam; | ||
| import org.jclouds.rest.annotations.ResponseParser; | ||
| import org.jclouds.rest.annotations.*; |
There was a problem hiding this comment.
The wildcard imports (jakarta.ws.rs.* and org.jclouds.rest.annotations.*) should be expanded to explicit imports to maintain consistency with the rest of the codebase. Other API files in the same package use explicit imports (e.g., SystemApi, StatisticsApi, CrumbIssuerApi).
| import jakarta.inject.Named; | ||
| import jakarta.ws.rs.*; |
There was a problem hiding this comment.
The wildcard imports (jakarta.ws.rs.*) should be expanded to explicit imports to maintain consistency with the rest of the codebase. Other API files in the same package use explicit imports (e.g., SystemApi, StatisticsApi, CrumbIssuerApi).
| import jakarta.inject.Named; | ||
| import jakarta.ws.rs.POST; | ||
| import jakarta.ws.rs.Path; | ||
| import org.jclouds.rest.annotations.*; |
There was a problem hiding this comment.
The wildcard import (org.jclouds.rest.annotations.*) should be expanded to explicit imports to maintain consistency with the rest of the codebase. Other API files in the same package use explicit imports (e.g., SystemApi, StatisticsApi).
|
|
||
| import java.io.Closeable; | ||
|
|
||
| import com.cdancy.jenkins.rest.features.*; |
There was a problem hiding this comment.
The wildcard import (com.cdancy.jenkins.rest.features.*) should be expanded to explicit imports to maintain consistency with the rest of the codebase and improve code clarity.
| import com.cdancy.jenkins.rest.features.*; | |
| import com.cdancy.jenkins.rest.features.CrumbIssuerApi; | |
| import com.cdancy.jenkins.rest.features.JobsApi; | |
| import com.cdancy.jenkins.rest.features.PluginManagerApi; | |
| import com.cdancy.jenkins.rest.features.QueueApi; | |
| import com.cdancy.jenkins.rest.features.StatisticsApi; | |
| import com.cdancy.jenkins.rest.features.SystemApi; | |
| import com.cdancy.jenkins.rest.features.ConfigurationAsCodeApi; | |
| import com.cdancy.jenkins.rest.features.UserApi; |
|
@xausky have you actually tried things out? Last time I tried to bump to guice 7.0 things did not work as expected. |
I have conducted preliminary tests on the projects I maintain, but I suggest you conduct some further necessary tests. |
This commit upgrades all dependency artifacts and source code from the legacy javax.* namespace to the new jakarta.* namespace.
This change is required to support modern application servers (e.g., Tomcat 10+, WildFly 26+, Jetty 11+).
BREAKING CHANGE: All users integrating this library must now use Jakarta EE compatible environments and update their own source code to use the jakarta.* imports. Compatibility with old Java EE environments (e.g., Tomcat 9, WildFly 25) is dropped.
Fixed the issue raised in #271, which is a breaking upgrade, so the major version number has also been changed