You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ch...@apache.org on 2018/02/27 13:27:28 UTC

[1/2] commons-release-plugin git commit: disabling plugin if not configured properly

Repository: commons-release-plugin
Updated Branches:
  refs/heads/1.1 0dbbda5d6 -> 79019d2c6


disabling plugin if not configured properly


Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/ad9c69f3
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/ad9c69f3
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/ad9c69f3

Branch: refs/heads/1.1
Commit: ad9c69f377e1056c18273866eab3973e05afcec4
Parents: 0dbbda5
Author: Rob Tompkins <ch...@gmail.com>
Authored: Tue Feb 27 08:02:50 2018 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Tue Feb 27 08:26:47 2018 -0500

----------------------------------------------------------------------
 .../CommonsDistributionDetachmentMojo.java      | 13 ++++++++++--
 .../mojos/CommonsDistributionStagingMojo.java   | 20 ++++++++++++-------
 .../mojos/CommonsSiteCompressionMojo.java       | 21 +++++++++++++++++---
 3 files changed, 42 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/ad9c69f3/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java
index 6b79e0f..72f632c 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java
@@ -82,23 +82,32 @@ public class CommonsDistributionDetachmentMojo extends AbstractMojo {
     /**
      * The working directory in <code>target</code> that we use as a sandbox for the plugin.
      */
-    @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory")
+    @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin",
+            property = "commons.outputDirectory")
     private File workingDirectory;
 
     /**
      * The subversion staging url to which we upload all of our staged artifacts.
      */
-    @Parameter(required = true)
+    @Parameter(defaultValue = "", property = "commons.distSvnStagingUrl")
     private String distSvnStagingUrl;
 
     @Override
     public void execute() throws MojoExecutionException {
+        if ("".equals(distSvnStagingUrl)) {
+            getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run");
+            return;
+        }
         getLog().info("Detaching Assemblies");
         for (Object attachedArtifact : project.getAttachedArtifacts()) {
             if (ARTIFACT_TYPES_TO_DETACH.contains(((Artifact) attachedArtifact).getType())) {
                 detachedArtifacts.add((Artifact) attachedArtifact);
             }
         }
+        if (detachedArtifacts.isEmpty()) {
+            getLog().info("Current project contains no distributions. Not executing.");
+            return;
+        }
         for (Artifact artifactToRemove : detachedArtifacts) {
             project.getAttachedArtifacts().remove(artifactToRemove);
         }

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/ad9c69f3/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
index aef8e24..1eb36c3 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -73,20 +73,21 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
      * The main working directory for the plugin, namely <code>target/commons-release-plugin</code>, but
      * that assumes that we're using the default maven <code>${project.build.directory}</code>.
      */
-    @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory")
+    @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", property = "commons.outputDirectory")
     private File workingDirectory;
 
     /**
      * The location to which to checkout the dist subversion repository under our working directory, which
      * was given above.
      */
-    @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin/scm", alias = "distCheckoutDirectory")
+    @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin/scm",
+            property = "commons.distCheckoutDirectory")
     private File distCheckoutDirectory;
 
     /**
      * The location of the RELEASE-NOTES.txt file such that multimodule builds can configure it.
      */
-    @Parameter(defaultValue = "${basedir}/RELEASE-NOTES.txt", alias = "releaseNotesLocation")
+    @Parameter(defaultValue = "${basedir}/RELEASE-NOTES.txt", property = "commons.releaseNotesLocation")
     private File releaseNotesFile;
 
     /**
@@ -103,7 +104,7 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
      * <code>scm:svn:https://dist.apache.org/repos/dist/dev/commons/foo</code>. Note. that the prefix to the
      * substring <code>https</code> is a requirement.
      */
-    @Parameter(required = true)
+    @Parameter(defaultValue = "", property = "commons.distSvnStagingUrl")
     private String distSvnStagingUrl;
 
     /**
@@ -120,6 +121,14 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
 
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
+        if ("".equals(distSvnStagingUrl)) {
+            getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run");
+            return;
+        }
+        if (!workingDirectory.exists()) {
+            getLog().info("Current project contains no distributions. Not executing.");
+            return;
+        }
         getLog().info("Preparing to stage distributions");
         try {
             ScmManager scmManager = new BasicScmManager();
@@ -129,9 +138,6 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
             SvnScmProviderRepository providerRepository = (SvnScmProviderRepository) repository.getProviderRepository();
             providerRepository.setUser(username);
             providerRepository.setPassword(password);
-            if (!workingDirectory.exists()) {
-                SharedFunctions.initDirectory(getLog(), workingDirectory);
-            }
             if (!distCheckoutDirectory.exists()) {
                 SharedFunctions.initDirectory(getLog(), distCheckoutDirectory);
             }

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/ad9c69f3/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
index 8d67dda..d4af916 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
@@ -52,15 +52,25 @@ public class CommonsSiteCompressionMojo extends AbstractMojo {
      * The working directory for the plugin which, assuming the maven uses the default
      * <code>${project.build.directory}</code>, this becomes <code>target/commons-release-plugin</code>.
      */
-    @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory")
+    @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin",
+            property = "commons.outputDirectory")
     private File workingDirectory;
 
     /**
      */
-    @Parameter(defaultValue = "${project.build.directory}/site", alias = "siteOutputDirectory")
+    @Parameter(defaultValue = "${project.build.directory}/site", property = "commons.siteOutputDirectory")
     private File siteDirectory;
 
     /**
+     * The url of the subversion repository to which we wish the artifacts to be staged. Typicallly
+     * this would need to be of the form:
+     * <code>scm:svn:https://dist.apache.org/repos/dist/dev/commons/foo</code>. Note. that the prefix to the
+     * substring <code>https</code> is a requirement.
+     */
+    @Parameter(defaultValue = "", property = "commons.distSvnStagingUrl")
+    private String distSvnStagingUrl;
+
+    /**
      * A variable for the process of creating the site.zip file.
      */
     private ScatterZipOutputStream dirs;
@@ -77,6 +87,10 @@ public class CommonsSiteCompressionMojo extends AbstractMojo {
 
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
+        if ("".equals(distSvnStagingUrl)) {
+            getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run");
+            return;
+        }
         if (!siteDirectory.exists()) {
             getLog().error("\"mvn site\" was not run before this goal, or a siteDirectory did not exist.");
             throw new MojoFailureException(
@@ -84,7 +98,8 @@ public class CommonsSiteCompressionMojo extends AbstractMojo {
             );
         }
         if (!workingDirectory.exists()) {
-            SharedFunctions.initDirectory(getLog(), workingDirectory);
+            getLog().info("Current project contains no distributions. Not executing.");
+            return;
         }
         try {
             filesToCompress = new ArrayList<>();


[2/2] commons-release-plugin git commit: writing tests for plugin being disabled by not setting commons.distSvnStagingUrl

Posted by ch...@apache.org.
writing tests for plugin being disabled by not setting commons.distSvnStagingUrl


Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/79019d2c
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/79019d2c
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/79019d2c

Branch: refs/heads/1.1
Commit: 79019d2c66e725b1fb0595c92d5f2331c9b5a575
Parents: ad9c69f
Author: Rob Tompkins <ch...@gmail.com>
Authored: Tue Feb 27 08:23:53 2018 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Tue Feb 27 08:27:07 2018 -0500

----------------------------------------------------------------------
 .../CommonsDistributionDetachmentMojo.java      |  5 +-
 .../mojos/CommonsDistributionStagingMojo.java   |  5 +-
 .../mojos/CommonsSiteCompressionMojo.java       |  5 +-
 .../CommonsDistributionDetachmentMojoTest.java  | 41 +++++++++++----
 .../CommonsDistributionStagingMojoTest.java     | 26 ++++++++-
 .../mojos/CommonsSiteCompressionMojoTest.java   | 28 +++++++++-
 .../compress-site/compress-site-disabled.xml    | 52 ++++++++++++++++++
 .../compress-site/compress-site-failure.xml     |  1 +
 .../mojos/compress-site/compress-site.xml       |  1 +
 .../detach-distributions-disabled.xml           | 51 ++++++++++++++++++
 .../stage-distributions-disabled.xml            | 55 ++++++++++++++++++++
 11 files changed, 253 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/79019d2c/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java
index 72f632c..83d45d7 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java
@@ -17,6 +17,7 @@
 package org.apache.commons.release.plugin.mojos;
 
 import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.release.plugin.SharedFunctions;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -94,8 +95,8 @@ public class CommonsDistributionDetachmentMojo extends AbstractMojo {
 
     @Override
     public void execute() throws MojoExecutionException {
-        if ("".equals(distSvnStagingUrl)) {
-            getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run");
+        if (StringUtils.isEmpty(distSvnStagingUrl)) {
+            getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run.");
             return;
         }
         getLog().info("Detaching Assemblies");

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/79019d2c/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
index 1eb36c3..361e8a2 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.release.plugin.mojos;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.release.plugin.SharedFunctions;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -121,8 +122,8 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
 
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
-        if ("".equals(distSvnStagingUrl)) {
-            getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run");
+        if (StringUtils.isEmpty(distSvnStagingUrl)) {
+            getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run.");
             return;
         }
         if (!workingDirectory.exists()) {

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/79019d2c/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
index d4af916..8ca88f8 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
@@ -18,6 +18,7 @@ package org.apache.commons.release.plugin.mojos;
 
 import org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator;
 import org.apache.commons.compress.archivers.zip.ScatterZipOutputStream;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.release.plugin.SharedFunctions;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -87,8 +88,8 @@ public class CommonsSiteCompressionMojo extends AbstractMojo {
 
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
-        if ("".equals(distSvnStagingUrl)) {
-            getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run");
+        if (StringUtils.isEmpty(distSvnStagingUrl)) {
+            getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run.");
             return;
         }
         if (!siteDirectory.exists()) {

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/79019d2c/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojoTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojoTest.java b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojoTest.java
index 4ea0353..d59e582 100644
--- a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojoTest.java
+++ b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojoTest.java
@@ -17,6 +17,8 @@
 package org.apache.commons.release.plugin.mojos;
 
 import org.apache.maven.plugin.testing.MojoRule;
+import org.codehaus.plexus.util.FileUtils;
+import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 
@@ -32,6 +34,8 @@ import static org.junit.Assert.assertNotNull;
  * @author chtompki
  */
 public class CommonsDistributionDetachmentMojoTest {
+    
+    private static final String COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH = "target/testing-commons-release-plugin";
 
     @Rule
     public MojoRule rule = new MojoRule() {
@@ -46,6 +50,14 @@ public class CommonsDistributionDetachmentMojoTest {
 
     private CommonsDistributionDetachmentMojo mojo;
 
+    @Before
+    public void setUp() throws Exception {
+        File testingDirectory = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH);
+        if (testingDirectory.exists()) {
+            FileUtils.deleteDirectory(testingDirectory);
+        }
+    }
+
     @Test
     public void testSuccess() throws Exception {
         File testPom = new File("src/test/resources/mojos/detach-distributions/detach-distributions.xml");
@@ -53,15 +65,15 @@ public class CommonsDistributionDetachmentMojoTest {
         assertTrue(testPom.exists());
         mojo = (CommonsDistributionDetachmentMojo) rule.lookupMojo("detach-distributions", testPom);
         mojo.execute();
-        File detachedTarGz = new File("target/testing-commons-release-plugin/mockAttachedTar.tar.gz");
-        File detachedTarGzAsc = new File("target/testing-commons-release-plugin/mockAttachedTar.tar.gz.asc");
-        File detachedTarMd5 = new File("target/testing-commons-release-plugin/mockAttachedTar.tar.gz.md5");
-        File detachedTarGzSha1 = new File("target/testing-commons-release-plugin/mockAttachedTar.tar.gz.sha1");
-        File detachedZip = new File("target/testing-commons-release-plugin/mockAttachedZip.zip");
-        File detachedZipAsc = new File("target/testing-commons-release-plugin/mockAttachedZip.zip.asc");
-        File detachedZipMd5 = new File("target/testing-commons-release-plugin/mockAttachedZip.zip.md5");
-        File detachedZipSha1 = new File("target/testing-commons-release-plugin/mockAttachedZip.zip.sha1");
-        File notDetachedMockAttachedFile = new File("target/testing-commons-release-plugin/mockAttachedFile.html");
+        File detachedTarGz = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/mockAttachedTar.tar.gz");
+        File detachedTarGzAsc = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/mockAttachedTar.tar.gz.asc");
+        File detachedTarMd5 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/mockAttachedTar.tar.gz.md5");
+        File detachedTarGzSha1 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/mockAttachedTar.tar.gz.sha1");
+        File detachedZip = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/mockAttachedZip.zip");
+        File detachedZipAsc = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/mockAttachedZip.zip.asc");
+        File detachedZipMd5 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/mockAttachedZip.zip.md5");
+        File detachedZipSha1 = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/mockAttachedZip.zip.sha1");
+        File notDetachedMockAttachedFile = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/mockAttachedFile.html");
         assertTrue(detachedTarGz.exists());
         assertTrue(detachedTarGzAsc.exists());
         assertTrue(detachedTarMd5.exists());
@@ -72,4 +84,15 @@ public class CommonsDistributionDetachmentMojoTest {
         assertTrue(detachedZipSha1.exists());
         assertFalse(notDetachedMockAttachedFile.exists());
     }
+
+    @Test
+    public void testDisabled() throws Exception {
+        File testPom = new File("src/test/resources/mojos/detach-distributions/detach-distributions-disabled.xml");
+        assertNotNull(testPom);
+        assertTrue(testPom.exists());
+        mojo = (CommonsDistributionDetachmentMojo) rule.lookupMojo("detach-distributions", testPom);
+        mojo.execute();
+        File testingDirectory = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH);
+        assertFalse(testingDirectory.exists());
+    }
 }

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/79019d2c/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojoTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojoTest.java b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojoTest.java
index 213cc5e..bf3906e 100644
--- a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojoTest.java
+++ b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojoTest.java
@@ -17,12 +17,15 @@
 package org.apache.commons.release.plugin.mojos;
 
 import org.apache.maven.plugin.testing.MojoRule;
+import org.codehaus.plexus.util.FileUtils;
+import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 
 import java.io.File;
 
 import static junit.framework.TestCase.assertTrue;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 
 /**
@@ -33,6 +36,8 @@ import static org.junit.Assert.assertNotNull;
  */
 public class CommonsDistributionStagingMojoTest {
 
+    private static final String COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH = "target/testing-commons-release-plugin";
+
     @Rule
     public MojoRule rule = new MojoRule() {
         @Override
@@ -48,6 +53,14 @@ public class CommonsDistributionStagingMojoTest {
 
     private CommonsDistributionStagingMojo mojoForTest;
 
+    @Before
+    public void setUp() throws Exception {
+        File testingDirectory = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH);
+        if (testingDirectory.exists()) {
+            FileUtils.deleteDirectory(testingDirectory);
+        }
+    }
+
     @Test
     public void testSuccess() throws Exception {
         File testPom = new File("src/test/resources/mojos/stage-distributions/stage-distributions.xml");
@@ -62,7 +75,18 @@ public class CommonsDistributionStagingMojoTest {
         File releaseNotesBasedir = new File("src/test/resources/mojos/stage-distributions/");
         mojoForTest.setBasedir(releaseNotesBasedir);
         mojoForTest.execute();
-        File targetScmDirectory = new File("target/testing-commons-release-plugin/scm");
+        File targetScmDirectory = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/scm");
         assertTrue(targetScmDirectory.exists());
     }
+
+    @Test
+    public void testDisabled() throws Exception {
+        File testPom = new File("src/test/resources/mojos/stage-distributions/stage-distributions-disabled.xml");
+        assertNotNull(testPom);
+        assertTrue(testPom.exists());
+        mojoForTest = (CommonsDistributionStagingMojo) rule.lookupMojo("stage-distributions", testPom);
+        mojoForTest.execute();
+        File testingDirectory = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH);
+        assertFalse(testingDirectory.exists());
+    }
 }

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/79019d2c/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
index cd01944..f69533a 100644
--- a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
+++ b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
@@ -18,6 +18,8 @@ package org.apache.commons.release.plugin.mojos;
 
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugin.testing.MojoRule;
+import org.codehaus.plexus.util.FileUtils;
+import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 
@@ -25,6 +27,7 @@ import java.io.File;
 
 import static junit.framework.TestCase.assertTrue;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 
 /**
@@ -35,6 +38,8 @@ import static org.junit.Assert.assertNotNull;
  */
 public class CommonsSiteCompressionMojoTest {
 
+    private static final String COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH = "target/testing-commons-release-plugin";
+
     @Rule
     public MojoRule rule = new MojoRule() {
         @Override
@@ -48,14 +53,24 @@ public class CommonsSiteCompressionMojoTest {
 
     protected CommonsSiteCompressionMojo mojo;
 
+    @Before
+    public void setUp() throws Exception {
+        File testingDirectory = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH);
+        if (testingDirectory.exists()) {
+            FileUtils.deleteDirectory(testingDirectory);
+        }
+    }
+
     @Test
     public void testCompressSiteSuccess() throws Exception {
+        File testingDirectory = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH);
+        testingDirectory.mkdir();
         File testPom = new File("src/test/resources/mojos/compress-site/compress-site.xml");
         assertNotNull(testPom);
         assertTrue(testPom.exists());
         mojo = (CommonsSiteCompressionMojo) rule.lookupMojo("compress-site", testPom);
         mojo.execute();
-        File siteZip = new File("target/testing-commons-release-plugin/site.zip");
+        File siteZip = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH + "/site.zip");
         assertTrue(siteZip.exists());
     }
 
@@ -73,4 +88,15 @@ public class CommonsSiteCompressionMojoTest {
             );
         }
     }
+
+    @Test
+    public void testDisabled() throws Exception {
+        File testPom = new File("src/test/resources/mojos/compress-site/compress-site-disabled.xml");
+        assertNotNull(testPom);
+        assertTrue(testPom.exists());
+        mojo = (CommonsSiteCompressionMojo) rule.lookupMojo("compress-site", testPom);
+        mojo.execute();
+        File testingDirectory = new File(COMMONS_RELEASE_PLUGIN_TEST_DIR_PATH);
+        assertFalse(testingDirectory.exists());
+    }
 }

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/79019d2c/src/test/resources/mojos/compress-site/compress-site-disabled.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/compress-site/compress-site-disabled.xml b/src/test/resources/mojos/compress-site/compress-site-disabled.xml
new file mode 100644
index 0000000..59d669c
--- /dev/null
+++ b/src/test/resources/mojos/compress-site/compress-site-disabled.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.commons.plugin.my.unit</groupId>
+  <artifactId>compress-site-disabled-test</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <name>Test MyMojo</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-release-plugin</artifactId>
+        <configuration>
+          <workingDirectory>target/testing-commons-release-plugin</workingDirectory>
+          <siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory>
+          <distSvnStagingUrl>something</distSvnStagingUrl>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/79019d2c/src/test/resources/mojos/compress-site/compress-site-failure.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/compress-site/compress-site-failure.xml b/src/test/resources/mojos/compress-site/compress-site-failure.xml
index 1c9c6ad..7d511d7 100644
--- a/src/test/resources/mojos/compress-site/compress-site-failure.xml
+++ b/src/test/resources/mojos/compress-site/compress-site-failure.xml
@@ -44,6 +44,7 @@
                 <configuration>
                     <workingDirectory>target/testing-commons-release-plugin</workingDirectory>
                     <siteDirectory>${basedir}/target/test-classes/mojos/junk</siteDirectory>
+                    <distSvnStagingUrl>something</distSvnStagingUrl>
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/79019d2c/src/test/resources/mojos/compress-site/compress-site.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/compress-site/compress-site.xml b/src/test/resources/mojos/compress-site/compress-site.xml
index 53323e1..256feb6 100644
--- a/src/test/resources/mojos/compress-site/compress-site.xml
+++ b/src/test/resources/mojos/compress-site/compress-site.xml
@@ -44,6 +44,7 @@
                 <configuration>
                     <workingDirectory>target/testing-commons-release-plugin</workingDirectory>
                     <siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory>
+                    <distSvnStagingUrl>something</distSvnStagingUrl>
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/79019d2c/src/test/resources/mojos/detach-distributions/detach-distributions-disabled.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/detach-distributions/detach-distributions-disabled.xml b/src/test/resources/mojos/detach-distributions/detach-distributions-disabled.xml
new file mode 100644
index 0000000..0a244e1
--- /dev/null
+++ b/src/test/resources/mojos/detach-distributions/detach-distributions-disabled.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.commons.release.plugin.unit</groupId>
+    <artifactId>detach-distributions-test</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>jar</packaging>
+    <name>Mock Pom For Testing CommonsDistributionDetachmentMojo</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-release-plugin</artifactId>
+                <configuration>
+                    <project implementation="org.apache.commons.release.plugin.stubs.DistributionDetachmentProjectStub" />
+                    <workingDirectory>target/testing-commons-release-plugin</workingDirectory>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/79019d2c/src/test/resources/mojos/stage-distributions/stage-distributions-disabled.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/stage-distributions/stage-distributions-disabled.xml b/src/test/resources/mojos/stage-distributions/stage-distributions-disabled.xml
new file mode 100644
index 0000000..75e038b
--- /dev/null
+++ b/src/test/resources/mojos/stage-distributions/stage-distributions-disabled.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.commons.release.plugin.unit</groupId>
+    <artifactId>stage-distributions-test</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>jar</packaging>
+    <name>Mock Pom For Testing CommonsDistributionStagingMojo</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-release-plugin</artifactId>
+                <configuration>
+                    <project implementation="org.apache.commons.release.plugin.stubs.DistributionDetachmentProjectStub" />
+                    <workingDirectory>target/testing-commons-release-plugin</workingDirectory>
+                    <distCheckoutDirectory>target/testing-commons-release-plugin/scm</distCheckoutDirectory>
+                    <releaseNotesFile>src/test/resources/mojos/stage-distributions/RELEASE-NOTES.txt</releaseNotesFile>
+                    <distSvnStagingUrl>scm:svn:https://dist.apache.org/repos/dist/dev/commons/release-plugin</distSvnStagingUrl>
+                    <dryRun>true</dryRun>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file