From 6916c9ae16a391e7ef076afc2bfa7efadb3556ff Mon Sep 17 00:00:00 2001 From: Lars Lindqvist Date: Mon, 17 Oct 2016 20:45:45 +0200 Subject: [PATCH] Add tidy.skip parameter. --- .../java/org/codehaus/mojo/tidy/TidyMojo.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/codehaus/mojo/tidy/TidyMojo.java b/src/main/java/org/codehaus/mojo/tidy/TidyMojo.java index 519dc20..bcfd9bf 100644 --- a/src/main/java/org/codehaus/mojo/tidy/TidyMojo.java +++ b/src/main/java/org/codehaus/mojo/tidy/TidyMojo.java @@ -48,6 +48,12 @@ public abstract class TidyMojo @Parameter(defaultValue = "${project}", required = true, readonly = true) protected MavenProject project; + /** + * Set this to 'true' to skip execution. + */ + @Parameter(property = "tidy.skip", defaultValue = "false") + protected boolean skip = false; + /** * Perform whatever build-process behavior this Mojo implements using the specified POM. * @@ -63,8 +69,10 @@ protected abstract void executeForPom( String pom ) public void execute() throws MojoExecutionException, MojoFailureException { - String pom = getProjectPom(); - executeForPom( pom ); + if(!isSkip()) { + String pom = getProjectPom(); + executeForPom( pom ); + } } /** @@ -106,4 +114,12 @@ protected String tidy( String pom ) throw new MojoExecutionException( e.getMessage(), e ); } } + + public boolean isSkip() { + return skip; + } + + public void setSkip(boolean skip) { + this.skip = skip; + } }