Repository: commons-release-plugin
Updated Branches:
  refs/heads/master c3745c421 -> 8af3b4c0a


COMMONSSITE-104: change file handing around signature generation


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

Branch: refs/heads/master
Commit: 8af3b4c0a269db99c09313c076b154de7a09b184
Parents: c3745c4
Author: Rob Tompkins <christopher.tompk...@capitalone.com>
Authored: Wed Feb 28 11:03:56 2018 -0500
Committer: Rob Tompkins <christopher.tompk...@capitalone.com>
Committed: Wed Feb 28 11:03:56 2018 -0500

----------------------------------------------------------------------
 src/changes/changes.xml                                        | 1 +
 .../plugin/mojos/CommonsDistributionDetachmentMojo.java        | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/8af3b4c0/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 6d23369..d62645a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -26,6 +26,7 @@
 
   <body>
     <release version="1.1" date="YYYY-MM-DD" description="tbd">
+      <action issue="COMMONSSITE-104" type="fix" dev="chtompki">Sha1 signature 
files now reflect actual signatures.</action>
       <action issue="COMMONSSITE-98"  type="add" dev="chtompki">Making the 
project more multi-module compatible</action>
       <action issue="COMMONSSITE-102" type="fix" dev="chtompki">Commons 
Release Plugin doesn't work with Commons Release Plugin</action>
       <action issue="COMMONSSITE-101" type="fix" dev="chtompki">Make 
-Dcommons.release.dryRun=true our commit toggle</action>

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/8af3b4c0/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 38f1f93..c5536fd 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
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.release.plugin.mojos;
 
+import java.nio.file.Files;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.release.plugin.SharedFunctions;
@@ -164,12 +165,11 @@ public class CommonsDistributionDetachmentMojo extends 
AbstractMojo {
         for (Artifact artifact : detachedArtifacts) {
             if (!artifact.getFile().getName().contains("asc")) {
                 try {
-                    FileInputStream artifactFileInputStream = new 
FileInputStream(artifact.getFile());
-                    String md5 = DigestUtils.md5Hex(artifactFileInputStream);
+                    String md5 = 
DigestUtils.md5Hex(Files.readAllBytes(artifact.getFile().toPath()));
                     getLog().info(artifact.getFile().getName() + " md5: " + 
md5);
                     PrintWriter md5Writer = new 
PrintWriter(getMd5FilePath(workingDirectory, artifact.getFile()));
                     md5Writer.println(md5);
-                    String sha1 = DigestUtils.sha1Hex(artifactFileInputStream);
+                    String sha1 = 
DigestUtils.sha1Hex(Files.readAllBytes(artifact.getFile().toPath()));
                     getLog().info(artifact.getFile().getName() + " sha1: " + 
sha1);
                     PrintWriter sha1Writer = new 
PrintWriter(getSha1FilePath(workingDirectory, artifact.getFile()));
                     sha1Writer.println(sha1);

Reply via email to