openrewrite / rewrite-migrate-java

OpenRewrite recipes for migrating to newer versions of Java.
Apache License 2.0
92 stars 65 forks source link

AddJaxbDependencies removes `javax.xml.bind:jaxb-api` when it is required by another dependency #504

Open pstreef opened 1 week ago

pstreef commented 1 week ago

What version of OpenRewrite are you using?

Moderne SaaS

How are you running OpenRewrite?

Moderne SaaS

What is the smallest, simplest way to reproduce the problem?

api("org.openrewrite:rewrite-maven:latest.integration")
implementation('javax.xml.bind:jaxb-api:latest.release')
implementation("net.logstash.logback:logstash-logback-encoder:latest.release")

What did you expect to see?

api("org.openrewrite:rewrite-maven:latest.integration")
implementation('javax.xml.bind:jaxb-api:latest.release')
implementation('jakarta.xml.bind:jakarta.xml.bind-api:4.0.2') {
    because("required by: rewrite-maven --> jackson-module-jaxb-annotations")
}
implementation("net.logstash.logback:logstash-logback-encoder:latest.release")

What did you see instead?

api("org.openrewrite:rewrite-maven:latest.integration")
implementation('jakarta.xml.bind:jakarta.xml.bind-api:4.0.2') {
    because("required by: rewrite-maven --> jackson-module-jaxb-annotations")
}
implementation("net.logstash.logback:logstash-logback-encoder:latest.release")

What is the full stack trace of any errors you encountered?

java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement

Are you interested in contributing a fix to OpenRewrite?