From 9860f92427d6208c41c8cdf1dd2557544cc8c223 Mon Sep 17 00:00:00 2001 From: Benson Margulies Date: Fri, 17 Jun 2016 07:44:50 -0400 Subject: [PATCH] PAXEXAM-794: add skip to start/stop. --- .../org/ops4j/pax/exam/maven/StartContainerMojo.java | 11 +++++++++++ .../org/ops4j/pax/exam/maven/StopContainerMojo.java | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/maven/exam-maven-plugin/src/main/java/org/ops4j/pax/exam/maven/StartContainerMojo.java b/maven/exam-maven-plugin/src/main/java/org/ops4j/pax/exam/maven/StartContainerMojo.java index 7438adfc8..57b3f146f 100644 --- a/maven/exam-maven-plugin/src/main/java/org/ops4j/pax/exam/maven/StartContainerMojo.java +++ b/maven/exam-maven-plugin/src/main/java/org/ops4j/pax/exam/maven/StartContainerMojo.java @@ -91,8 +91,19 @@ public class StartContainerMojo extends AbstractMojo { @Parameter private String[] vmOptions; + /** + * If true, skip execution. + */ + @Parameter + private boolean skip; + + @Override public void execute() throws MojoExecutionException, MojoFailureException { + if (skip) { + return; + } + getLog().debug("classpath for forked process:"); for (String cp : classpathElements) { getLog().debug(cp); diff --git a/maven/exam-maven-plugin/src/main/java/org/ops4j/pax/exam/maven/StopContainerMojo.java b/maven/exam-maven-plugin/src/main/java/org/ops4j/pax/exam/maven/StopContainerMojo.java index 1834ed132..dbd082f45 100644 --- a/maven/exam-maven-plugin/src/main/java/org/ops4j/pax/exam/maven/StopContainerMojo.java +++ b/maven/exam-maven-plugin/src/main/java/org/ops4j/pax/exam/maven/StopContainerMojo.java @@ -45,8 +45,18 @@ public class StopContainerMojo extends AbstractMojo { @Parameter(defaultValue = "${mojoExecution}", readonly = true) private MojoExecution mojoExecution; + /** + * If true, skip execution. + */ + @Parameter + private boolean skip; + @Override public void execute() throws MojoExecutionException, MojoFailureException { + if (skip) { + return; + } + Object object = getPluginContext().get(TEST_CONTAINER_RUNNER_KEY + mojoExecution.getExecutionId()); if (object == null) { throw new MojoExecutionException(