Skip to content

ChangeDependency passes changePluginDependencies through to the Maven recipe - #202

Merged
jkschneider merged 1 commit into
mainfrom
boot4/change-dependency-plugin-opt-out
Oct 3, 2026
Merged

jkschneider merged 1 commit into
mainfrom
boot4/change-dependency-plugin-opt-out

Conversation

@jkschneider

@jkschneider jkschneider commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Exposes the new changePluginDependencies option of ChangeDependencyGroupIdAndArtifactId on the language-agnostic ChangeDependency, so a declarative migration can swap a library for a Spring Boot starter without touching the same library inside a Maven plugin's dependencies. Defaults to true; no effect on Gradle.

Uses the constructor added in openrewrite/rewrite openrewrite/rewrite#9023. With two constructors, the nine-argument one carries @JsonCreator; it is written out rather than generated with Lombok's onConstructor_, which javadoc cannot read.

Found by a team of coding agents reviewing a Moderne run of org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0 over the 31 JHipster repositories (run 20261003115037-NUeOz). The issue is boot-starter-in-plugin-dependencies in the run's io.moderne.RecipeIssues data table (13 rows), and the fix was discussed and reviewed on the run's message board. A row from the table, as a generalized example:

The modular starter migration replaces Liquibase in the Maven plugin classpath with an application starter. (jhipster/jhipster-sample-app-noi18n, pom.xml, recipe org.openrewrite.java.dependencies.ChangeDependency)

Before:

<build><plugins><plugin>
  <groupId>org.liquibase</groupId><artifactId>liquibase-maven-plugin</artifactId>
  <dependencies><dependency>
    <groupId>org.liquibase</groupId><artifactId>liquibase-core</artifactId><version>${liquibase.version}</version>
  </dependency></dependencies>
</plugin></plugins></build>

What the recipe produced:

<build><plugins><plugin>
  <groupId>org.liquibase</groupId><artifactId>liquibase-maven-plugin</artifactId>
  <dependencies><dependency>
    <groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-liquibase</artifactId><version>4.0.8</version>
  </dependency></dependencies>
</plugin></plugins></build>

Expected:

<build><plugins><plugin>
  <groupId>org.liquibase</groupId><artifactId>liquibase-maven-plugin</artifactId>
  <dependencies><dependency>
    <groupId>org.liquibase</groupId><artifactId>liquibase-core</artifactId><version>${liquibase.version}</version>
  </dependency></dependencies>
</plugin></plugins></build>

@jkschneider
jkschneider force-pushed the boot4/change-dependency-plugin-opt-out branch from de8624a to 59d44b4 Compare October 3, 2026 18:46
@jkschneider
jkschneider merged commit 0f9a659 into main Oct 3, 2026
1 check passed
@jkschneider
jkschneider deleted the boot4/change-dependency-plugin-opt-out branch October 3, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant