Merge pull request #381 from awhitford/SkipMojo

Added basic skip option for mojos.
This commit is contained in:
Jeremy Long
2015-10-20 05:58:16 -04:00

View File

@@ -246,6 +246,12 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
*/
@Parameter(property = "zipExtensions", required = false)
private String zipExtensions;
/**
* Skip Dependency Check altogether.
*/
@SuppressWarnings("CanBeFinal")
@Parameter(property = "dependency-check.skip", defaultValue = "false", required = false)
private boolean skip = false;
/**
* Skip Analysis for Test Scope Dependencies.
*/
@@ -325,9 +331,13 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
*/
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
validateAggregate();
project.setContextValue(getOutputDirectoryContextKey(), this.outputDirectory);
runCheck();
if (skip) {
getLog().info("Skipping " + getName(Locale.US));
} else {
validateAggregate();
project.setContextValue(getOutputDirectoryContextKey(), this.outputDirectory);
runCheck();
}
}
/**