From 3ddbf490f4d61adbe6557c93a990b5e4b2360a61 Mon Sep 17 00:00:00 2001 From: Vincent Potucek Date: Sun, 11 May 2025 23:30:48 +0200 Subject: [PATCH 1/4] failOnDryRunDetection --- .../maven/failOnDryRunDetectionMojo.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/main/java/org/openrewrite/maven/failOnDryRunDetectionMojo.java diff --git a/src/main/java/org/openrewrite/maven/failOnDryRunDetectionMojo.java b/src/main/java/org/openrewrite/maven/failOnDryRunDetectionMojo.java new file mode 100644 index 00000000..62229a3d --- /dev/null +++ b/src/main/java/org/openrewrite/maven/failOnDryRunDetectionMojo.java @@ -0,0 +1,31 @@ +/* + * Copyright 2020 the original author or authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * https://www.apache.org/licenses/LICENSE-2.0 + *

+ * 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.maven; + +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.ResolutionScope; + +/** + * Generate warnings to the console for any recipe that would make changes, but do not make changes. + *

+ * This variant of rewrite:dryRun will not fork the maven life cycle and can be used (along with other goals) without + * triggering repeated life-cycle events. It will execute the maven build up to the process-test-classes phase. + */ +@Mojo(name = "failOnDryRunDetection", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true, + defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES) +public class failOnDryRunDetectionMojo extends AbstractRewriteDryRunMojo { +} From 26528a0b2efa8735edc324ad3e76d6f1d7f76ca1 Mon Sep 17 00:00:00 2001 From: Vincent Potucek Date: Sun, 11 May 2025 23:31:58 +0200 Subject: [PATCH 2/4] RewriteFailOnDryRunDetectionMojo --- ...DetectionMojo.java => RewriteFailOnDryRunDetectionMojo.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/main/java/org/openrewrite/maven/{failOnDryRunDetectionMojo.java => RewriteFailOnDryRunDetectionMojo.java} (94%) diff --git a/src/main/java/org/openrewrite/maven/failOnDryRunDetectionMojo.java b/src/main/java/org/openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java similarity index 94% rename from src/main/java/org/openrewrite/maven/failOnDryRunDetectionMojo.java rename to src/main/java/org/openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java index 62229a3d..770a8040 100644 --- a/src/main/java/org/openrewrite/maven/failOnDryRunDetectionMojo.java +++ b/src/main/java/org/openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java @@ -27,5 +27,5 @@ */ @Mojo(name = "failOnDryRunDetection", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true, defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES) -public class failOnDryRunDetectionMojo extends AbstractRewriteDryRunMojo { +public class RewriteFailOnDryRunDetectionMojo extends AbstractRewriteDryRunMojo { } From ea4fb1325f41e641449ac803fa61c48d0b479918 Mon Sep 17 00:00:00 2001 From: Vincent Potucek Date: Sun, 11 May 2025 23:33:12 +0200 Subject: [PATCH 3/4] RewriteFailOnDryRunDetectionMojo --- .../openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/org/openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java b/src/main/java/org/openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java index 770a8040..b60d1812 100644 --- a/src/main/java/org/openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java +++ b/src/main/java/org/openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java @@ -20,10 +20,7 @@ import org.apache.maven.plugins.annotations.ResolutionScope; /** - * Generate warnings to the console for any recipe that would make changes, but do not make changes. - *

- * This variant of rewrite:dryRun will not fork the maven life cycle and can be used (along with other goals) without - * triggering repeated life-cycle events. It will execute the maven build up to the process-test-classes phase. + * Breaks build when changes detected. */ @Mojo(name = "failOnDryRunDetection", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true, defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES) From 1b932c70996459d625caf4a51e534b74a9f21bed Mon Sep 17 00:00:00 2001 From: Vincent Potucek Date: Sun, 11 May 2025 23:34:12 +0200 Subject: [PATCH 4/4] RewriteFailOnDryRunDetectionMojo --- .../org/openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java b/src/main/java/org/openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java index b60d1812..9a0350eb 100644 --- a/src/main/java/org/openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java +++ b/src/main/java/org/openrewrite/maven/RewriteFailOnDryRunDetectionMojo.java @@ -20,7 +20,7 @@ import org.apache.maven.plugins.annotations.ResolutionScope; /** - * Breaks build when changes detected. + * Breaks build on change detection. */ @Mojo(name = "failOnDryRunDetection", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true, defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES)