When upgrading the external parent pom of a multi-module project, it looks like the changes aren't properly propagated when UpdateMavenModel runs.
Example project https://github.com/tschut/openrewrite-revision-bug
Reproduction steps:
- Check out the above repo
- run
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run --define rewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE --define rewrite.activeRecipes=org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0
- you'll see an added dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-flyway</artifactId>
<version>4.0.5</version>
</dependency>
The explicit version <version>4.0.5</version> is unexpected, as that version is managed by Spring Boot.
We've debugged this quite a bit, and it looks like UpdateMavenModel runs multiple times. First it runs for the root pom.xml, which correctly uses spring-boot-starter-parent:4.0.5. After that, it runs for app/pom.xml, which appears to not use the updated grandparent, but uses the old version for spring-boot-starter-parent.
Note that in this reproducer project the issue seems to be not very bad (it's just an explicit version you don't need), but in particular with all the new modules in Spring Boot 4 the issue in a real world project could be very annoying.
Perhaps a regression on
When upgrading the external parent pom of a multi-module project, it looks like the changes aren't properly propagated when
UpdateMavenModelruns.Example project https://github.com/tschut/openrewrite-revision-bug
Reproduction steps:
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run --define rewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE --define rewrite.activeRecipes=org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0The explicit version
<version>4.0.5</version>is unexpected, as that version is managed by Spring Boot.We've debugged this quite a bit, and it looks like
UpdateMavenModelruns multiple times. First it runs for the rootpom.xml, which correctly usesspring-boot-starter-parent:4.0.5. After that, it runs forapp/pom.xml, which appears to not use the updated grandparent, but uses the old version forspring-boot-starter-parent.Note that in this reproducer project the issue seems to be not very bad (it's just an explicit version you don't need), but in particular with all the new modules in Spring Boot 4 the issue in a real world project could be very annoying.
Perhaps a regression on