rewrite-migrate-java icon indicating copy to clipboard operation
rewrite-migrate-java copied to clipboard

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

Open pstreef opened this issue 8 months ago • 0 comments

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?

pstreef avatar Jun 28 '24 07:06 pstreef