Skip to content
Permalink
Browse files
COMMONSSITE-104: change file handing around signature generation
  • Loading branch information
Rob Tompkins committed Feb 28, 2018
1 parent c3745c4 commit 8af3b4c0a269db99c09313c076b154de7a09b184
Showing 2 changed files with 4 additions and 3 deletions.
@@ -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>
@@ -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 @@ private void sha1AndMd5SignArtifacts() throws MojoExecutionException {
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);

0 comments on commit 8af3b4c

Please sign in to comment.