-
Notifications
You must be signed in to change notification settings - Fork 91
Upgrade existing jakarta.annotation-api to 2.0.x for EE9 #729
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
Upgrade existing jakarta.annotation-api to 2.0.x for EE9 #729
Conversation
There was a problem hiding this 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
I noticed this fails this test rewrite-migrate-java/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxToJakartaTest.java Lines 577 to 613 in 5adb91d
I'm trying to figure out if this change makes sense, or whether the tests need to be updated. |
There was a problem hiding this 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 997-1007
- lines 1036-1042
Thanks for the call out; fine to change that dependency version; I think it might just have been missed. As for your other question: not sure; I'd expect folks to run Java8toJava11, and through that AddCommonAnnotationsDependencies before they run JavaxMigrationToJakarta, but it's hard to say at times. You're right to point out that the scanning Fine to merge this PR already from my side, but wasn't sure if there's more you'd like to work through before a merge. |
I think this might be good to go. It's also now in line with what pretty much all of the other EE9 recipes do, where they all run |
What's changed?
In the Jakarta EE 9 recipe list, add an extra recipe step to ensure
jakarta.annotation-api
is upgraded to the correct version for EE9 in case an older version was used.What's your motivation?
QUESTION: Is it even a valid case to run
AddCommonAnnotationsDependencies
first, before runningJavaxMigrationToJakarta
(Jakarta EE 9 migration)? Should the EE 9 migration supercede the former recipe?If
AddCommonAnnotationsDependencies
is run beforehand, it updates the originaljavax.annotation-api
to usejakarta.annotation-api:1.3.x
. The EE9 recipe then fails to upgrade to2.0.x
because the originaljavax.annotation-api
no longer exists.When this recipe runs afterwards, it should update the version if the jakarta version of the artifact already existed.
Checklist