Skip to content
Permalink
Browse files
Check the result of checking out files from the SCM.
  • Loading branch information
garydgregory committed Jul 3, 2018
1 parent d6ac566 commit 2543f323dca0aeecf023a11b3cab295871851ee9
Showing 4 changed files with 10 additions and 4 deletions.
@@ -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">
@@ -33,6 +33,7 @@
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 void execute() throws MojoExecutionException, MojoFailureException {
}
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 void execute() throws MojoExecutionException, MojoFailureException {
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());
@@ -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>
@@ -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>

0 comments on commit 2543f32

Please sign in to comment.