JavaxWsToJakartaWs recipe does not add jakarta.ws.rs-api when upgrading from JavaEE 8 to JavaEE 9#723
Merged
timtebeek merged 6 commits intoMay 16, 2025
Conversation
bmuschko
commented
May 13, 2025
| groupId: jakarta.ws.rs | ||
| artifactId: jakarta.ws.rs-api | ||
| version: 3.0.x | ||
| onlyIfUsing: javax.ws.rs.core.* |
Contributor
Author
There was a problem hiding this comment.
Using javax.ws.rs.* does not seem to pass the relevant test.
Contributor
There was a problem hiding this comment.
I think it's fine doing it like this then!
jevanlingen
approved these changes
May 13, 2025
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
timtebeek
reviewed
May 16, 2025
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.
What's changed?
The declarative recipe
JavaxWsToJakartaWs.What's your motivation?
The dependency
javax.javaee-api:8.0contains the classes fromjavax.ws.rs.*. When migrating from JavaEE 8 to JavaEE 9, those class has been removed. The replacement package isjakarta.ws.rs.*which is not part of the JavaEE 9 dependency. It needs to be provided by another dependencyjakarta.ws.rs:jakarta.ws.rs-api.The recipe in charge for this switch, org.openrewrite.java.migrate.jakarta.JavaxWsToJakartaWs, does not take into account that the dependency does not exist yet. It will force the end user to declare the dependency manually. The recipe should take care of adding the dependency as well if it doesn't exist.
Anything in particular you'd like reviewers to focus on?
No
Anyone you would like to review specifically?
No
Have you considered any alternatives or workarounds?
No