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

Missing Dependendcy jakarta.xml.bind:jakarta.xml.bind-api after Spring 2.7 to 3.0 migration

Open MBoegers opened this issue 2 years ago • 1 comments

What version of OpenRewrite are you using?

rewrite-maven-plugin:5.4.2

How are you running OpenRewrite?

From terminal via maven on a single module maven project. I run open Rewrite against Spring Petclinic https://github.com/spring-projects/spring-petclinic

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

  1. Clone https://github.com/spring-projects/spring-petclinic
  2. Reset to Commit 276880edef4c3d1029865d19d6d28e982b9d4d01 it is the commit with the update to Spring Boot 2.7.3
  3. run ./mvnw -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE -Drewrite.activeRecipes=org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0
  4. run ./mvnw clean compile

What did you expect to see?

Build succeeds and Application is runable.

What did you see instead?

Missing dependency jakarta.xml.bind:jakarta.xml.bind-api

Are you interested in contributing a fix to OpenRewrite?

not yet

MBoegers avatar Sep 01 '23 05:09 MBoegers

Thanks for the detailed report @MBoegers ! We did a fresh batch of releases yesterday, and I just reran through the steps above with that; the problem is still there unfortunately. After the recipe run, an analysis of the dependencies shows me this: Image

Seems like there's a transitive runtime dependency; not sure if that's picked up as a reason not to add an explicit dependency. 🤔

timtebeek avatar Sep 13 '23 11:09 timtebeek

I feel this might have been another case as we saw here, where incorrect scope information lead to dependencies (not) added.

  • https://github.com/openrewrite/rewrite/pull/4273
  • https://github.com/openrewrite/rewrite-migrate-java/pull/499
  • https://github.com/openrewrite/rewrite-hibernate/pull/29
  • https://github.com/openrewrite/rewrite-spring/issues/486

I'd lean towards closing this one and reopening a new one if necessary, given that time since.

timtebeek avatar Jun 20 '24 19:06 timtebeek