Skip to content

Honor Maven compiler processor paths when adding Lombok binding - #1361

Merged
jkschneider merged 6 commits into
mainfrom
fix/mapstruct-binding-processor-path
Oct 25, 2026
Merged

jkschneider merged 6 commits into
mainfrom
fix/mapstruct-binding-processor-path

Conversation

@jkschneider

@jkschneider jkschneider commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

AddLombokMapstructBinding adds a redundant compile dependency when a Maven module already configures lombok-mapstruct-binding on its compiler annotation processor path.

Replace the dependency-only YAML helper with a module-aware Maven visitor under the same recipe ID. It preserves existing dependency scope/version, checks inherited and managed compiler paths and property-based coordinates, and respects explicit child configuration overrides before falling back to plugin management. Modules that still need binding keep receiving it.

Validation:

  • Tests-only CI run 40204158674 reproduces the issue as the sole failure on both build JDK and Java 25 (2314 and 2318 tests respectively).
  • Supplemental cached-artifact RewriteTest runs prove the original failure and 25 focused candidate cases, including module isolation, missing binding, unrelated plugins/processors, existing dependency scope/version, inherited/managed configuration, locally declared non-inherited plugins, parent/child non-inheritance, explicit overrides, and idempotency.
  • Independent review identified the managed-configuration override case; a regression reproduces it before the follow-up correction.
  • Full candidate CI passed on both the build JDK and Java 25. Local Gradle compilation is blocked at Code Genome build-plugin resolution.

The change handles compiler-level configuration. Execution-specific processor paths retain existing behavior.

Fixes #1319.

@jkschneider jkschneider changed the title Avoid redundant Lombok MapStruct dependency for configured processors Honor Maven compiler processor paths when adding Lombok binding Oct 25, 2026
@jkschneider
jkschneider marked this pull request as ready for review October 25, 2026 15:32
@jkschneider
jkschneider merged commit 48dcd43 into main Oct 25, 2026
2 checks passed
@jkschneider
jkschneider deleted the fix/mapstruct-binding-processor-path branch October 25, 2026 15:32
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

1 participant