Skip to content

Conversation

bmuschko
Copy link
Contributor

What's changed?

The declarative recipe JavaxWsToJakartaWs.

What's your motivation?

The dependency javax.javaee-api:8.0 contains the classes from javax.ws.rs.*. When migrating from JavaEE 8 to JavaEE 9, those class has been removed. The replacement package is jakarta.ws.rs.* which is not part of the JavaEE 9 dependency. It needs to be provided by another dependency jakarta.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

@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite May 13, 2025
groupId: jakarta.ws.rs
artifactId: jakarta.ws.rs-api
version: 3.0.x
onlyIfUsing: javax.ws.rs.core.*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using javax.ws.rs.* does not seem to pass the relevant test.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine doing it like this then!

@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite May 13, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • src/main/resources/META-INF/rewrite/examples.yml
    • lines 3282-3281
    • lines 3328-3346

timtebeek and others added 2 commits May 16, 2025 02:58
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • src/main/resources/META-INF/rewrite/examples.yml
    • lines 3282-3281
    • lines 3328-3346

@timtebeek timtebeek merged commit 648c5c2 into openrewrite:main May 16, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite May 16, 2025
@bmuschko bmuschko deleted the bm/add-jakarta-ws-dep-if-transitive branch May 20, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants