Skip to content

Conversation

rlsanders4
Copy link
Contributor

What's changed?

A new recipe was added to update the JAXB API dependency when migrating to Jakarta EE 9 and remove any JAXB runtime dependencies.

What's your motivation?

This is necessary when migrating to an app server where the JAXB implementation is provided by the runtime.

Anyone you would like to review specifically?

@timtebeek

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

@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite May 16, 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 997-1007
    • lines 1036-1042

@rlsanders4 rlsanders4 requested a review from timtebeek May 16, 2025 18:04
newVersion: 2.5.x
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.javax.AddJaxbAPIDependencies
Copy link
Member

Choose a reason for hiding this comment

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

Should we reference this new org.openrewrite.java.migrate.javax.AddJaxbAPIDependencies from anywhere?
Without that folks would need to seek it out and run it specifically, whereas perhaps it needs to hook into Java 11 upgrade?

Copy link
Contributor Author

@rlsanders4 rlsanders4 May 16, 2025

Choose a reason for hiding this comment

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

The current Java 11 upgrade list adds some jakarta runtime dependencies to the application. That makes sense for some use cases, but it will cause errors for users migrating to an app server which already provides these runtime dependencies. Currently, we are calling some of the Java 11 recipes piecemeal in order to support that managed scenario instead of using the full Java 11 list.

For this recipe, we will use it instead of the existing AddJaxbDependencies which is already on the Java 11 list.

One potential long term solution is to break up the Java 11 list:

  • A list for users migrating to a managed environment
  • A list for users migrating to an unmanaged environment (this could remain the default suggestion)
  • A list for common recipes to be referenced by both

This would add some additional complexity though.

Copy link
Contributor

Choose a reason for hiding this comment

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

This has now been implemented with the latest commits here

@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite May 16, 2025
@timtebeek timtebeek added the recipe Recipe requested label May 17, 2025
@rlsanders4 rlsanders4 requested a review from timtebeek May 19, 2025 21:54
Copy link
Contributor

@evie-lau evie-lau left a comment

Choose a reason for hiding this comment

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

Could we move the common recipe components into another group, and have the runtime/no-runtime recipe groups call that along with their own runtime addition/removal recipes?

@github-project-automation github-project-automation bot moved this from Ready to Review to In Progress in OpenRewrite May 29, 2025
@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite May 31, 2025
Copy link
Member

@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 both for iterating on the right approach here!

@timtebeek timtebeek merged commit ae0d30a into openrewrite:main May 31, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
recipe Recipe requested
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants