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/e3ce9a1a Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/e3ce9a1a Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/e3ce9a1a Branch: refs/heads/master Commit: e3ce9a1ad8eaf38405ccf01ff5729dc4a171468f Parents: a744f76 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:05:57 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/e3ce9a1a/src/changes/changes.xml ---------------------------------------------------------------------- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index cb8df7f..016998d 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -26,6 +26,7 @@ <body> <release version="1.1" date="2018-02-28" description="1.1"> + <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/e3ce9a1a/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);