Skip to content

Replace the discontinued mapstruct-jdk8 artifact before upgrading the MapStruct version - #1260

Merged
jkschneider merged 1 commit into
mainfrom
boot4/mapstruct-jdk8
Oct 3, 2026
Merged

jkschneider merged 1 commit into
mainfrom
boot4/mapstruct-jdk8

Conversation

@jkschneider

Copy link
Copy Markdown
Member

The Java 17 migration raises the shared mapstruct.version property to 1.6.x, but org.mapstruct:mapstruct-jdk8 was discontinued after 1.3, so the project ends up asking for a version that does not exist. The migration now first changes the artifact to org.mapstruct:mapstruct.

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 mapstruct-jdk8-artifact-retained in the run's io.moderne.RecipeIssues data table (4 rows), and the fix was discussed and reviewed on the run's message board. A row from the table, as a generalized example:

Updating the shared MapStruct version leaves the discontinued mapstruct-jdk8 artifact at a nonexistent version. (jhipster/jhipster-sample-app-ng1, pom.xml, recipe org.openrewrite.java.dependencies.UpgradeDependencyVersion)

Before:

<properties><mapstruct.version>1.2.0.Final</mapstruct.version></properties><dependencies><dependency><groupId>org.mapstruct</groupId><artifactId>mapstruct-jdk8</artifactId><version>${mapstruct.version}</version></dependency><dependency><groupId>org.mapstruct</groupId><artifactId>mapstruct-processor</artifactId><version>${mapstruct.version}</version></dependency></dependencies>

What the recipe produced:

<properties><mapstruct.version>1.6.3</mapstruct.version></properties><dependencies><dependency><groupId>org.mapstruct</groupId><artifactId>mapstruct-jdk8</artifactId><version>${mapstruct.version}</version></dependency><dependency><groupId>org.mapstruct</groupId><artifactId>mapstruct-processor</artifactId><version>${mapstruct.version}</version></dependency></dependencies>

Expected:

<properties><mapstruct.version>1.6.3</mapstruct.version></properties><dependencies><dependency><groupId>org.mapstruct</groupId><artifactId>mapstruct</artifactId><version>${mapstruct.version}</version></dependency><dependency><groupId>org.mapstruct</groupId><artifactId>mapstruct-processor</artifactId><version>${mapstruct.version}</version></dependency></dependencies>

First of a stack of 3 pull requests from the same review; each later one is based on the one before it.

@jkschneider
jkschneider added this pull request to stack #1263 October 3, 2026 21:29
@jkschneider
jkschneider merged commit 64eaf09 into main Oct 3, 2026
1 check passed
@jkschneider
jkschneider deleted the boot4/mapstruct-jdk8 branch October 3, 2026 21:31
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