Skip to content

feat(jakarta): Migrate library to Jakarta EE 9+ namespace#397

Open
xausky wants to merge 1 commit intocdancy:masterfrom
xausky:master
Open

feat(jakarta): Migrate library to Jakarta EE 9+ namespace#397
xausky wants to merge 1 commit intocdancy:masterfrom
xausky:master

Conversation

@xausky
Copy link

@xausky xausky commented Dec 10, 2025

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

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.
Copilot AI review requested due to automatic review settings December 10, 2025 06:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and javax.annotation to their jakarta.* 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.

Comment on lines +27 to +31
import jakarta.inject.Named;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import org.jclouds.Fallbacks;
import org.jclouds.rest.annotations.*;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot uses AI. Check for mistakes.
Comment on lines +32 to +37
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.*;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +29
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.*;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +28
import jakarta.inject.Named;
import jakarta.ws.rs.*;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot uses AI. Check for mistakes.
import jakarta.inject.Named;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import org.jclouds.rest.annotations.*;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot uses AI. Check for mistakes.

import java.io.Closeable;

import com.cdancy.jenkins.rest.features.*;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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;

Copilot uses AI. Check for mistakes.
@cdancy
Copy link
Owner

cdancy commented Dec 10, 2025

@xausky have you actually tried things out? Last time I tried to bump to guice 7.0 things did not work as expected.

@cdancy cdancy self-assigned this Dec 10, 2025
@xausky
Copy link
Author

xausky commented Dec 10, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants