commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chtom...@apache.org
Subject commons-release-plugin git commit: Add another info level toggle to the plugin run
Date Wed, 28 Feb 2018 12:41:10 GMT
Repository: commons-release-plugin
Updated Branches:
  refs/heads/master f37d774f9 -> c3745c421


Add another info level toggle to the plugin run


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/c3745c42
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/c3745c42
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/c3745c42

Branch: refs/heads/master
Commit: c3745c4219b6d8418432c2ea8512bb17472780d1
Parents: f37d774
Author: Rob Tompkins <chtompki@gmail.com>
Authored: Wed Feb 28 07:40:50 2018 -0500
Committer: Rob Tompkins <chtompki@gmail.com>
Committed: Wed Feb 28 07:41:00 2018 -0500

----------------------------------------------------------------------
 .../plugin/mojos/CommonsDistributionDetachmentMojo.java  | 11 +++++++++++
 .../plugin/mojos/CommonsDistributionStagingMojo.java     | 11 +++++++++++
 .../release/plugin/mojos/CommonsSiteCompressionMojo.java | 11 +++++++++++
 .../mojos/compress-site/compress-site-disabled.xml       |  1 +
 .../mojos/compress-site/compress-site-failure.xml        |  1 +
 src/test/resources/mojos/compress-site/compress-site.xml |  1 +
 .../detach-distributions-disabled.xml                    |  1 +
 .../mojos/detach-distributions/detach-distributions.xml  |  1 +
 .../stage-distributions/stage-distributions-disabled.xml |  1 +
 .../mojos/stage-distributions/stage-distributions.xml    |  1 +
 10 files changed, 40 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/c3745c42/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 83d45d7..38f1f93 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
@@ -93,8 +93,19 @@ public class CommonsDistributionDetachmentMojo extends AbstractMojo {
     @Parameter(defaultValue = "", property = "commons.distSvnStagingUrl")
     private String distSvnStagingUrl;
 
+    /**
+     * A parameter to generally avoid running unless it is specifically turned on by the
consuming module.
+     */
+    @Parameter(defaultValue = "false", property = "commons.release.isDistModule")
+    private Boolean isDistModule;
+
     @Override
     public void execute() throws MojoExecutionException {
+        if (!isDistModule) {
+            getLog().info("This module is marked as a non distribution " +
+                    "or assembly module, and the plugin will not run.");
+            return;
+        }
         if (StringUtils.isEmpty(distSvnStagingUrl)) {
             getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin
will not run.");
             return;

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/c3745c42/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 361e8a2..2965f1e 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
@@ -109,6 +109,12 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
     private String distSvnStagingUrl;
 
     /**
+     * A parameter to generally avoid running unless it is specifically turned on by the
consuming module.
+     */
+    @Parameter(defaultValue = "false", property = "commons.release.isDistModule")
+    private Boolean isDistModule;
+
+    /**
      * The username for the distribution subversion repository. This is typically your apache
id.
      */
     @Parameter(property = "user.name")
@@ -122,6 +128,11 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
 
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
+        if (!isDistModule) {
+            getLog().info("This module is marked as a non distribution " +
+                    "or assembly module, and the plugin will not run.");
+            return;
+        }
         if (StringUtils.isEmpty(distSvnStagingUrl)) {
             getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin
will not run.");
             return;

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/c3745c42/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 8ca88f8..b313089 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
@@ -72,6 +72,12 @@ public class CommonsSiteCompressionMojo extends AbstractMojo {
     private String distSvnStagingUrl;
 
     /**
+     * A parameter to generally avoid running unless it is specifically turned on by the
consuming module.
+     */
+    @Parameter(defaultValue = "false", property = "commons.release.isDistModule")
+    private Boolean isDistModule;
+
+    /**
      * A variable for the process of creating the site.zip file.
      */
     private ScatterZipOutputStream dirs;
@@ -88,6 +94,11 @@ public class CommonsSiteCompressionMojo extends AbstractMojo {
 
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
+        if (!isDistModule) {
+            getLog().info("This module is marked as a non distribution " +
+                    "or assembly module, and the plugin will not run.");
+            return;
+        }
         if (StringUtils.isEmpty(distSvnStagingUrl)) {
             getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin
will not run.");
             return;

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/c3745c42/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
index 59d669c..9bd1221 100644
--- a/src/test/resources/mojos/compress-site/compress-site-disabled.xml
+++ b/src/test/resources/mojos/compress-site/compress-site-disabled.xml
@@ -44,6 +44,7 @@
         <configuration>
           <workingDirectory>target/testing-commons-release-plugin</workingDirectory>
           <siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory>
+          <isDistModule>true</isDistModule>
           <distSvnStagingUrl>something</distSvnStagingUrl>
         </configuration>
       </plugin>

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/c3745c42/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 7d511d7..ddfeee4 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>
+                    <isDistModule>true</isDistModule>
                     <distSvnStagingUrl>something</distSvnStagingUrl>
                 </configuration>
             </plugin>

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/c3745c42/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 256feb6..065832e 100644
--- a/src/test/resources/mojos/compress-site/compress-site.xml
+++ b/src/test/resources/mojos/compress-site/compress-site.xml
@@ -45,6 +45,7 @@
                     <workingDirectory>target/testing-commons-release-plugin</workingDirectory>
                     <siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory>
                     <distSvnStagingUrl>something</distSvnStagingUrl>
+                    <isDistModule>true</isDistModule>
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/c3745c42/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
index 0a244e1..a825e52 100644
--- a/src/test/resources/mojos/detach-distributions/detach-distributions-disabled.xml
+++ b/src/test/resources/mojos/detach-distributions/detach-distributions-disabled.xml
@@ -43,6 +43,7 @@
                 <artifactId>commons-release-plugin</artifactId>
                 <configuration>
                     <project implementation="org.apache.commons.release.plugin.stubs.DistributionDetachmentProjectStub"
/>
+                    <isDistModule>true</isDistModule>
                     <workingDirectory>target/testing-commons-release-plugin</workingDirectory>
                 </configuration>
             </plugin>

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/c3745c42/src/test/resources/mojos/detach-distributions/detach-distributions.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/detach-distributions/detach-distributions.xml b/src/test/resources/mojos/detach-distributions/detach-distributions.xml
index 84738e6..a00ac0a 100644
--- a/src/test/resources/mojos/detach-distributions/detach-distributions.xml
+++ b/src/test/resources/mojos/detach-distributions/detach-distributions.xml
@@ -44,6 +44,7 @@
                 <configuration>
                     <project implementation="org.apache.commons.release.plugin.stubs.DistributionDetachmentProjectStub"
/>
                     <workingDirectory>target/testing-commons-release-plugin</workingDirectory>
+                    <isDistModule>true</isDistModule>
                     <distSvnStagingUrl>mockDistSvnStagingUrl</distSvnStagingUrl>
                 </configuration>
             </plugin>

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/c3745c42/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
index 75e038b..eedc2be 100644
--- a/src/test/resources/mojos/stage-distributions/stage-distributions-disabled.xml
+++ b/src/test/resources/mojos/stage-distributions/stage-distributions-disabled.xml
@@ -47,6 +47,7 @@
                     <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>
+                    <isDistModule>false</isDistModule>
                     <dryRun>true</dryRun>
                 </configuration>
             </plugin>

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/c3745c42/src/test/resources/mojos/stage-distributions/stage-distributions.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/stage-distributions/stage-distributions.xml b/src/test/resources/mojos/stage-distributions/stage-distributions.xml
index 75e038b..b37c7ec 100644
--- a/src/test/resources/mojos/stage-distributions/stage-distributions.xml
+++ b/src/test/resources/mojos/stage-distributions/stage-distributions.xml
@@ -47,6 +47,7 @@
                     <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>
+                    <isDistModule>true</isDistModule>
                     <dryRun>true</dryRun>
                 </configuration>
             </plugin>


Mime
View raw message