From dc9f4291f80bcb15dd63721abbba70f4ab0c371a Mon Sep 17 00:00:00 2001 From: tison Date: Wed, 28 Sep 2022 21:18:52 +0800 Subject: [PATCH] fix: maven plugin should identify skip config key Signed-off-by: tison --- .../com/diffplug/spotless/maven/AbstractSpotlessMojo.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java b/plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java index c68733f387..f163fa2802 100644 --- a/plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java +++ b/plugin-maven/src/main/java/com/diffplug/spotless/maven/AbstractSpotlessMojo.java @@ -91,6 +91,9 @@ public abstract class AbstractSpotlessMojo extends AbstractMojo { @Parameter(defaultValue = "${mojoExecution.goal}", required = true, readonly = true) private String goal; + @Parameter(defaultValue = "false") + private boolean skip; + @Parameter(property = "spotless.apply.skip", defaultValue = "false") private boolean applySkip; @@ -200,6 +203,10 @@ public final void execute() throws MojoExecutionException { } private boolean shouldSkip() { + if (skip) { + return true; + } + switch (goal) { case GOAL_CHECK: return checkSkip; @@ -208,6 +215,7 @@ private boolean shouldSkip() { default: break; } + return false; }