From e341150618609acaabc8e90c300a35cebf4a52d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82?= Date: Fri, 15 Sep 2017 10:45:00 +0200 Subject: [PATCH] Support for "skip" configuration parameter --- .../java/edu/illinois/nondex/plugin/AbstractNonDexMojo.java | 2 ++ .../src/main/java/edu/illinois/nondex/plugin/DebugMojo.java | 4 ++++ .../src/main/java/edu/illinois/nondex/plugin/NonDexMojo.java | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/nondex-maven-plugin/src/main/java/edu/illinois/nondex/plugin/AbstractNonDexMojo.java b/nondex-maven-plugin/src/main/java/edu/illinois/nondex/plugin/AbstractNonDexMojo.java index 3cbd9d56..00114208 100644 --- a/nondex-maven-plugin/src/main/java/edu/illinois/nondex/plugin/AbstractNonDexMojo.java +++ b/nondex-maven-plugin/src/main/java/edu/illinois/nondex/plugin/AbstractNonDexMojo.java @@ -141,6 +141,8 @@ public abstract class AbstractNonDexMojo extends AbstractMojo { protected String loggingLevel; // Generic properties + @Parameter(property = "skip", defaultValue = "false") + protected boolean skip; @Parameter(property = "project") protected MavenProject mavenProject; @Parameter(defaultValue = "${project.build.directory}") diff --git a/nondex-maven-plugin/src/main/java/edu/illinois/nondex/plugin/DebugMojo.java b/nondex-maven-plugin/src/main/java/edu/illinois/nondex/plugin/DebugMojo.java index a525286d..531ce677 100644 --- a/nondex-maven-plugin/src/main/java/edu/illinois/nondex/plugin/DebugMojo.java +++ b/nondex-maven-plugin/src/main/java/edu/illinois/nondex/plugin/DebugMojo.java @@ -64,6 +64,10 @@ public class DebugMojo extends AbstractNonDexMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { + if (skip) { + Logger.getGlobal().log(Level.INFO, "Execution skipped"); + return; + } super.execute(); this.parseExecutions(); this.parseTests(); diff --git a/nondex-maven-plugin/src/main/java/edu/illinois/nondex/plugin/NonDexMojo.java b/nondex-maven-plugin/src/main/java/edu/illinois/nondex/plugin/NonDexMojo.java index 4ead7b94..e837a06f 100644 --- a/nondex-maven-plugin/src/main/java/edu/illinois/nondex/plugin/NonDexMojo.java +++ b/nondex-maven-plugin/src/main/java/edu/illinois/nondex/plugin/NonDexMojo.java @@ -62,6 +62,10 @@ public class NonDexMojo extends AbstractNonDexMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { + if (skip) { + Logger.getGlobal().log(Level.INFO, "Execution skipped"); + return; + } super.execute(); Logger.getGlobal().log(Level.INFO, "The original argline is: " + this.originalArgLine); MojoExecutionException allExceptions = null;