Skip to content

Upgrade jakarta.annotation-api to 3.0.x in Jakarta EE 11 recipe#1042

Merged
timtebeek merged 3 commits intomainfrom
upgrade-annotation-api-ee11
Apr 2, 2026
Merged

Upgrade jakarta.annotation-api to 3.0.x in Jakarta EE 11 recipe#1042
timtebeek merged 3 commits intomainfrom
upgrade-annotation-api-ee11

Conversation

@timtebeek
Copy link
Copy Markdown
Member

Summary

  • Add jakarta.annotation:jakarta.annotation-api 3.0.x version upgrade to UpdateJakartaPlatform11
  • Add test coverage for JavaxAnnotationMigrationToJakartaAnnotation

Problem

The UpdateJakartaPlatform11 recipe upgrades jakarta.platform and jakarta.servlet.jsp-api but was missing the upgrade for jakarta.annotation-api to 3.0.x. Jakarta EE 10 already handles the 2.1.x upgrade via MigrationToJakarta10Apis, but EE 11 should bring it to 3.0.x per the Jakarta EE 11 platform BOM.

A customer reported that after running a Java 21 + Jakarta EE migration, their POM had jakarta.annotation-api at an older version instead of 3.0.x.

Solution

Added UpgradeDependencyVersion for jakarta.annotation:jakarta.annotation-api with newVersion: 3.0.x to the UpdateJakartaPlatform11 recipe, following the same pattern as the existing entries.

Also added JavaxAnnotationMigrationToJakartaAnnotationTest with two test cases covering explicit dependency migration and the no-explicit-dependency scenario.

Test plan

  • New tests for JavaxAnnotationMigrationToJakartaAnnotation pass
  • JakartaEE11Test passes
  • Full jakarta.* and javax.* test suites pass with no regressions

The UpdateJakartaPlatform11 recipe was missing the version upgrade for
jakarta.annotation:jakarta.annotation-api to 3.0.x, which is the
version specified by the Jakarta EE 11 platform BOM. Jakarta EE 10
already upgrades to 2.1.x via MigrationToJakarta10Apis.

Also adds tests for JavaxAnnotationMigrationToJakartaAnnotation covering
both the explicit dependency migration and the no-explicit-dependency
scenarios.
@timtebeek timtebeek merged commit 276316d into main Apr 2, 2026
1 check passed
@timtebeek timtebeek deleted the upgrade-annotation-api-ee11 branch April 2, 2026 18:33
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant