diff --git a/src/main/java/org/openrewrite/java/migrate/AddLombokMapstructBindingMavenDependencyOnly.java b/src/main/java/org/openrewrite/java/migrate/AddLombokMapstructBindingMavenDependencyOnly.java
new file mode 100644
index 0000000000..3c03858987
--- /dev/null
+++ b/src/main/java/org/openrewrite/java/migrate/AddLombokMapstructBindingMavenDependencyOnly.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2026 the original author or authors.
+ *
+ * Licensed under the Moderne Source Available License (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.openrewrite.java.migrate;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import lombok.EqualsAndHashCode;
+import lombok.Value;
+import org.openrewrite.ExecutionContext;
+import org.openrewrite.Recipe;
+import org.openrewrite.TreeVisitor;
+import org.openrewrite.internal.ListUtils;
+import org.openrewrite.maven.AddDependencyVisitor;
+import org.openrewrite.maven.MavenIsoVisitor;
+import org.openrewrite.maven.tree.Plugin;
+import org.openrewrite.maven.tree.ResolvedPom;
+import org.openrewrite.xml.tree.Xml;
+
+import java.util.List;
+
+@Value
+@EqualsAndHashCode(callSuper = false)
+public class AddLombokMapstructBindingMavenDependencyOnly extends Recipe {
+ String displayName = "Add `lombok-mapstruct-binding` dependency for Maven when both MapStruct and Lombok are used";
+
+ String description = "Add the `lombok-mapstruct-binding` Maven dependency when this module uses both Lombok and MapStruct " +
+ "and the binding is not already a dependency or configured on the compiler annotation processor path.";
+
+ @Override
+ public TreeVisitor, ExecutionContext> getVisitor() {
+ return new MavenIsoVisitor() {
+ @Override
+ public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) {
+ if (getResolutionResult().findDependencies("org.projectlombok", "lombok", null).isEmpty() ||
+ getResolutionResult().findDependencies("org.mapstruct", "mapstruct", null).isEmpty() ||
+ !getResolutionResult().findDependencies("org.projectlombok", "lombok-mapstruct-binding", null).isEmpty()) {
+ return document;
+ }
+ ResolvedPom pom = getResolutionResult().getPom();
+ // The resolved model can omit even locally declared plugins with inherited=false.
+ List plugins = ListUtils.concatAll(pom.getPlugins(), nonInheritedPlugins(pom.getRequested().getPlugins()));
+ List managedPlugins = ListUtils.concatAll(pom.getPluginManagement(), nonInheritedPlugins(pom.getRequested().getPluginManagement()));
+ if (hasBindingProcessor(pom, plugins) ||
+ !overridesManagedProcessorPaths(plugins) && hasBindingProcessor(pom, managedPlugins)) {
+ return document;
+ }
+ return (Xml.Document) new AddDependencyVisitor("org.projectlombok", "lombok-mapstruct-binding", "0.2.0",
+ null, null, null, null, null, null, null).visitNonNull(document, ctx);
+ }
+
+ private List nonInheritedPlugins(List plugins) {
+ return ListUtils.map(plugins, plugin -> "false".equals(plugin.getInherited()) ? plugin : null);
+ }
+
+ private boolean overridesManagedProcessorPaths(List plugins) {
+ for (Plugin plugin : plugins) {
+ if (!"org.apache.maven.plugins".equals(plugin.getGroupId()) ||
+ !"maven-compiler-plugin".equals(plugin.getArtifactId())) {
+ continue;
+ }
+ JsonNode configuration = plugin.getConfiguration();
+ if (configuration != null &&
+ ("override".equals(configuration.path("combine.self").asText()) ||
+ "override".equals(configuration.path("annotationProcessorPaths").path("combine.self").asText()))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean hasBindingProcessor(ResolvedPom pom, List plugins) {
+ for (Plugin plugin : plugins) {
+ if (!"org.apache.maven.plugins".equals(plugin.getGroupId()) ||
+ !"maven-compiler-plugin".equals(plugin.getArtifactId())) {
+ continue;
+ }
+ JsonNode configuration = plugin.getConfiguration();
+ if (configuration == null) {
+ continue;
+ }
+ JsonNode paths = configuration.path("annotationProcessorPaths").path("path");
+ if (paths.isArray()) {
+ for (JsonNode path : paths) {
+ if (isBinding(pom, path)) {
+ return true;
+ }
+ }
+ } else if (isBinding(pom, paths)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isBinding(ResolvedPom pom, JsonNode path) {
+ return "org.projectlombok".equals(pom.getValue(path.path("groupId").asText(""))) &&
+ "lombok-mapstruct-binding".equals(pom.getValue(path.path("artifactId").asText("")));
+ }
+ };
+ }
+}
diff --git a/src/main/resources/META-INF/rewrite/java-version-17.yml b/src/main/resources/META-INF/rewrite/java-version-17.yml
index 628b2c13d4..61c295a60f 100644
--- a/src/main/resources/META-INF/rewrite/java-version-17.yml
+++ b/src/main/resources/META-INF/rewrite/java-version-17.yml
@@ -379,20 +379,3 @@ recipeList:
artifactId: lombok-mapstruct-binding
version: 0.2.0
- org.openrewrite.java.migrate.AddMapstructAnnotationProcessorPath
----
-type: specs.openrewrite.org/v1beta/recipe
-name: org.openrewrite.java.migrate.AddLombokMapstructBindingMavenDependencyOnly
-displayName: Add `lombok-mapstruct-binding` dependency for Maven when both MapStruct and Lombok are used
-description: >-
- Add the `lombok-mapstruct-binding` Maven dependency when it does not already exist. Expects the caller to have checked
- that both MapStruct and Lombok are used.
-preconditions:
- - org.openrewrite.java.dependencies.search.DoesNotIncludeDependency:
- groupId: org.projectlombok
- artifactId: lombok-mapstruct-binding
- - org.openrewrite.Singleton
-recipeList:
- - org.openrewrite.maven.AddDependency:
- groupId: org.projectlombok
- artifactId: lombok-mapstruct-binding
- version: 0.2.0
diff --git a/src/test/java/org/openrewrite/java/migrate/AddLombokMapstructBindingMavenDependencyOnlyTest.java b/src/test/java/org/openrewrite/java/migrate/AddLombokMapstructBindingMavenDependencyOnlyTest.java
new file mode 100644
index 0000000000..9b3b0e45f5
--- /dev/null
+++ b/src/test/java/org/openrewrite/java/migrate/AddLombokMapstructBindingMavenDependencyOnlyTest.java
@@ -0,0 +1,318 @@
+/*
+ * Copyright 2026 the original author or authors.
+ *
+ * Licensed under the Moderne Source Available License (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *