Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tidy.skip parameter. #12

Merged
merged 1 commit into from
Nov 8, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 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 = false;

/**
* Perform whatever build-process behavior this <code>Mojo</code> implements using the specified POM.
*
Expand All @@ -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 );
}
}

/**
Expand Down Expand Up @@ -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;
}
}