You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/07/03 00:04:24 UTC

commons-release-plugin git commit: Check the result of checking out files from the SCM.

Repository: commons-release-plugin
Updated Branches:
  refs/heads/master d6ac566dd -> 2543f323d


Check the result of checking out files from the SCM.

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

Branch: refs/heads/master
Commit: 2543f323dca0aeecf023a11b3cab295871851ee9
Parents: d6ac566
Author: Gary Gregory <ga...@gmail.com>
Authored: Mon Jul 2 20:04:21 2018 -0400
Committer: Gary Gregory <ga...@gmail.com>
Committed: Mon Jul 2 20:04:21 2018 -0400

----------------------------------------------------------------------
 src/changes/changes.xml                                     | 1 +
 .../plugin/mojos/CommonsDistributionStagingMojo.java        | 9 +++++++--
 .../stage-distributions/stage-distributions-disabled.xml    | 2 +-
 .../mojos/stage-distributions/stage-distributions.xml       | 2 +-
 4 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/2543f323/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index ebe1a7a..bbd6abd 100755
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -27,6 +27,7 @@
   <body>
     <release version="1.4" date="2018-MM-DD" description="Version 1.4">
       <action type="update" dev="ggregory">Better error message when files cannot be checked in to the SCM.</action>
+      <action type="fix" dev="ggregory">Check the result of checking out files from the SCM.</action>
     </release>
 
     <release version="1.3" date="2018-06-15" description="Version 1.3">

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/2543f323/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 b701d4a..e2ad60b 100755
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -33,6 +33,7 @@ import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.command.add.AddScmResult;
 import org.apache.maven.scm.command.checkin.CheckInScmResult;
+import org.apache.maven.scm.command.checkout.CheckOutScmResult;
 import org.apache.maven.scm.manager.BasicScmManager;
 import org.apache.maven.scm.manager.ScmManager;
 import org.apache.maven.scm.provider.ScmProvider;
@@ -191,7 +192,11 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
             }
             ScmFileSet scmFileSet = new ScmFileSet(distCheckoutDirectory);
             getLog().info("Checking out dist from: " + distSvnStagingUrl);
-            provider.checkOut(repository, scmFileSet);
+            final CheckOutScmResult checkOutResult = provider.checkOut(repository, scmFileSet);
+            if (!checkOutResult.isSuccess()) {
+                throw new MojoExecutionException("Failed to checkout files from SCM: "
+                        + checkOutResult.getProviderMessage() + " [" + checkOutResult.getCommandOutput() + "]");
+            }
             File copiedReleaseNotes = copyReleaseNotesToWorkingDirectory();
             copyDistributionsIntoScmDirectoryStructureAndAddToSvn(copiedReleaseNotes,
                     provider, repository);
@@ -204,7 +209,7 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
                         fileSet
                 );
                 if (!addResult.isSuccess()) {
-                    throw new MojoExecutionException("Failed to add files to scm: " + addResult.getProviderMessage()
+                    throw new MojoExecutionException("Failed to add files to SCM: " + addResult.getProviderMessage()
                             + " [" + addResult.getCommandOutput() + "]");
                 }
                 getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/2543f323/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 023a57f..589dddd 100755
--- a/src/test/resources/mojos/stage-distributions/stage-distributions-disabled.xml
+++ b/src/test/resources/mojos/stage-distributions/stage-distributions-disabled.xml
@@ -47,7 +47,7 @@
                     <distCheckoutDirectory>target/testing-commons-release-plugin/scm</distCheckoutDirectory>
                     <siteDirectory>${basedir}/target/test-classes/mojos/detach-distributions/target/site</siteDirectory>
                     <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>
+                    <distSvnStagingUrl>scm:svn:https://dist.apache.org/repos/dist/dev/commons/commons-release-plugin</distSvnStagingUrl>
                     <isDistModule>false</isDistModule>
                     <dryRun>true</dryRun>
                     <commonsReleaseVersion>1.0-SNAPSHOT</commonsReleaseVersion>

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/2543f323/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 b191969..b8ad1ca 100755
--- a/src/test/resources/mojos/stage-distributions/stage-distributions.xml
+++ b/src/test/resources/mojos/stage-distributions/stage-distributions.xml
@@ -47,7 +47,7 @@
                     <distCheckoutDirectory>target/testing-commons-release-plugin/scm</distCheckoutDirectory>
                     <siteDirectory>${basedir}/target/test-classes/mojos/detach-distributions/target/site</siteDirectory>
                     <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>
+                    <distSvnStagingUrl>scm:svn:https://dist.apache.org/repos/dist/dev/commons/commons-release-plugin</distSvnStagingUrl>
                     <isDistModule>true</isDistModule>
                     <dryRun>true</dryRun>
                     <commonsReleaseVersion>1.0-SNAPSHOT</commonsReleaseVersion>