Skip to content

Align JakartaEE migrations with EE9 vs EE10 versions #674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

tobli
Copy link
Contributor

@tobli tobli commented Feb 13, 2025

What's changed?

This commit updates both the EE9 and the EE10 recipe to pin specification jars to the version corresponding to the umbrella EE version. The versions are aligned with https://github.com/jakartaee/jakartaee-api/blob/9.1.0/pom.xml and https://github.com/jakartaee/jakartaee-api/blob/10.0.0/pom.xml respectively.

Where runtime dependencies are added, e.g. com.sun.xml.ws:jaxws-rt, the implementation matching the spec version is selected: com.sun.xml.ws:jaxws-rt:3.x for jakarta.xml.ws:jakarta.xml.ws-api:3.0.x and com.sun.xml.ws:jaxws-rt:4.x for jakarta.xml.ws:jakarta.xml.ws-api:4.0.x

What's your motivation?

The org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta recipe states in the description that it will migrate to the EE9 version. However it updates both api and implementation jars to latest.release. As a consequence the EE9 migration will pick a version for EE10 or later. Since later Jakarta EE versions sometime remove or change api, this may lead to compile time or runtime errors.

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

Comment on lines +47 to +50
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: jakarta.faces
artifactId: jakarta.faces-api
newVersion: 4.0.x
Copy link
Contributor Author

Choose a reason for hiding this comment

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

needed to add this, previously the EE9 migration included the Faces 4 (part of EE10) update

Comment on lines -1013 to +1022
newVersion: 9.0.0
newVersion: 9.1.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are no api changes with EE 9.1, just Java11 support

- org.openrewrite.java.ChangePackage:
oldPackageName: javax.annotation
newPackageName: jakarta.annotation
recursive: true
- org.openrewrite.java.ChangePackage:
oldPackageName: jakarta.annotation.processing
newPackageName: javax.annotation.processing

- org.openrewrite.java.ChangePackage:
oldPackageName: jakarta.annotation.concurrent
Copy link
Contributor Author

Choose a reason for hiding this comment

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

jakarta.annotation.concurrent is not part of the EE9 api

@timtebeek timtebeek self-requested a review February 13, 2025 12:20
@tobli tobli force-pushed the jakarta-ee-versions branch from cfc9f5d to 48323eb Compare February 13, 2025 12:54
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the changes here! Might not feel very exciting in the moment, but as you've found it's good to be deliberate about the versions used such that there's minimal surprises for folks targeting an intermediate version of EE, or see that included in their composites.

I've added one comment on the Jackson migration thread above; other than that I think this looks good already.

@tobli
Copy link
Contributor Author

tobli commented Feb 13, 2025

Thanks a lot for the changes here! Might not feel very exciting in the moment, but as you've found it's good to be deliberate about the versions used such that there's minimal surprises for folks targeting an intermediate version of EE, or see that included in their composites.

I've added one comment on the Jackson migration thread above; other than that I think this looks good already.

Thanks! Adding this would be very helpful, I've been bitten by the compatibility issues myself.

I took out the Jackson changes, as you noted they are not strictly necessary. Better to keep the scope small.

@tobli tobli requested a review from timtebeek February 13, 2025 13:31
@tobli tobli marked this pull request as ready for review February 13, 2025 13:45
# WHY
The `org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta` recipe states in the description that it will migrate to the EE9 version. However it updates both api and implementation jars to `latest.release`. As a consequence the EE9 migration will pick a version for EE10 or later. Since later Jakarta EE versions sometime remove or change api, this may lead to compile time or runtime errors.

# WHAT
This commit updates both the EE9 and the EE10 recipe to pin specification jars to the version corresponding to the umbrella EE version. The versions are aligned with https://github.com/jakartaee/jakartaee-api/blob/9.1.0/pom.xml and https://github.com/jakartaee/jakartaee-api/blob/10.0.0/pom.xml respectively.
Where runtime dependencies are added, e.g. `com.sun.xml.ws:jaxws-rt`, the implementation matching the spec version is selected: `com.sun.xml.ws:jaxws-rt:3.x` for `jakarta.xml.ws:jakarta.xml.ws-api:3.0.x` and `com.sun.xml.ws:jaxws-rt:4.x` for `jakarta.xml.ws:jakarta.xml.ws-api:4.0.x`
@tobli tobli force-pushed the jakarta-ee-versions branch from d47ca41 to 8d15910 Compare February 13, 2025 13:48
description: Jakarta EE 10 updates some apis compared to Jakarta EE 9.
tags:
- jakarta
# NOTE: The spec versions in this section comes from https://github.com/jakartaee/jakartaee-api/blob/10.0.0/pom.xml
Copy link
Contributor Author

Choose a reason for hiding this comment

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

linking to the BOM where the spec versions are defined

@@ -25,6 +25,7 @@ tags:
- jakarta
# TODO: Update XML references if necessary.
# TODO: Rename bootstrapping files if necessary.
# NOTE: The spec versions in this section comes from https://github.com/jakartaee/jakartaee-api/blob/9.1.0/pom.xml
Copy link
Contributor Author

Choose a reason for hiding this comment

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

linking to the BOM where the spec versions are defined

@timtebeek timtebeek added bug Something isn't working enhancement New feature or request labels Feb 13, 2025
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the quick turnaround here @tobli !

@timtebeek timtebeek merged commit 2467d78 into openrewrite:main Feb 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants