Skip to content

Commit

Permalink
COMMONSSITE-104: change file handing around signature generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Tompkins committed Feb 28, 2018
1 parent c3745c4 commit 8af3b4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8af3b4c

Please sign in to comment.