Skip to content

Commit

Permalink
fix: maven plugin should identify skip config key
Browse files Browse the repository at this point in the history
Signed-off-by: tison <wander4096@gmail.com>
  • Loading branch information
tisonkun committed Sep 28, 2022
1 parent f4ee554 commit dc9f429
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -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;

Expand Down Expand Up @@ -200,6 +203,10 @@ public final void execute() throws MojoExecutionException {
}

private boolean shouldSkip() {
if (skip) {
return true;
}

switch (goal) {
case GOAL_CHECK:
return checkSkip;
Expand All @@ -208,6 +215,7 @@ private boolean shouldSkip() {
default:
break;
}

return false;
}

Expand Down

0 comments on commit dc9f429

Please sign in to comment.