Retain javax.xml.bind:jaxb-api when jackson-module-jaxb-annotations is present

MSAL

When migrating from javax.xml.bind to jakarta.xml.bind 3.0+, the javax.xml.bind:jaxb-api dependency is normally replaced. However, if jackson-module-jaxb-annotations is on the classpath (and still uses the javax.xml.bind namespace), this recipe ensures javax.xml.bind:jaxb-api remains available as a runtime dependency to prevent NoClassDefFoundError.

org.openrewrite.java.migrate.jakarta.RetainJaxbApiForJackson
mod run . --recipe=org.openrewrite.java.migrate.jakarta.RetainJaxbApiForJackson

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Add Gradle or Maven dependency javax.xml.bind:jaxb-api:2.3.x