Skip to content

Commit

Permalink
Add tidy.skip parameter. Thanks to Lars Lindqvist.
Browse files Browse the repository at this point in the history
Fixes #12.
  • Loading branch information
dennisl committed Nov 8, 2016
2 parents 6c9e1fc + 721aaa2 commit f18f9af
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/org/codehaus/mojo/tidy/TidyMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
* Perform whatever build-process behavior this <code>Mojo</code> implements using the specified POM.
*
Expand All @@ -63,6 +69,11 @@ protected abstract void executeForPom( String pom )
public void execute()
throws MojoExecutionException, MojoFailureException
{
if ( skip )
{
getLog().info( "Tidy is skipped." );
return;
}
String pom = getProjectPom();
executeForPom( pom );
}
Expand Down

0 comments on commit f18f9af

Please sign in to comment.