Repository: commons-release-plugin
Updated Branches:
  refs/heads/master 76d8739d0 -> cd8911a70


javadoc & don't compute hashes twice


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

Branch: refs/heads/master
Commit: cd8911a70c6af6284e7e13113369829c218b6972
Parents: 76d8739
Author: Rob Tompkins <chtom...@apache.org>
Authored: Wed May 30 15:07:56 2018 -0400
Committer: Rob Tompkins <chtom...@apache.org>
Committed: Wed May 30 15:07:56 2018 -0400

----------------------------------------------------------------------
 .../plugin/mojos/CommonsDistributionDetachmentMojo.java | 12 ++++++------
 .../plugin/mojos/CommonsDistributionStagingMojo.java    |  3 ++-
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/cd8911a7/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 821b4d1..fd5972d 100755
--- 
a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java
+++ 
b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java
@@ -271,6 +271,10 @@ public class CommonsDistributionDetachmentMojo extends 
AbstractMojo {
     private void hashArtifacts() throws MojoExecutionException {
         for (Artifact artifact : detachedArtifacts) {
             if (!artifact.getFile().getName().contains("asc")) {
+                StringBuffer artifactKey = new StringBuffer();
+                artifactKey.append(artifact.getArtifactId()).append('-')
+                        .append(artifact.getVersion()).append('-')
+                        .append(artifact.getType());
                 try {
                     // MD5
                     String digest;
@@ -283,18 +287,14 @@ public class CommonsDistributionDetachmentMojo extends 
AbstractMojo {
                         printWriter.println(digest);
                     }
                     // SHA-1
-                    try (FileInputStream fis = new 
FileInputStream(artifact.getFile())) {
-                        digest = DigestUtils.sha1Hex(fis);
-                    }
+                    digest = artifactSha1s.getProperty(artifactKey.toString());
                     getLog().info(artifact.getFile().getName() + " sha1: " + 
digest);
                     try (PrintWriter printWriter = new PrintWriter(
                             getSha1FilePath(workingDirectory, 
artifact.getFile()))) {
                         printWriter.println(digest);
                     }
                     // SHA-256
-                    try (FileInputStream fis = new 
FileInputStream(artifact.getFile())) {
-                        digest = DigestUtils.sha256Hex(fis);
-                    }
+                    digest = 
artifactSha256s.getProperty(artifactKey.toString());
                     getLog().info(artifact.getFile().getName() + " sha256: " + 
digest);
                     try (PrintWriter printWriter = new PrintWriter(
                             getSha256FilePath(workingDirectory, 
artifact.getFile()))) {

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/cd8911a7/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
 
b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
index 36ccd33..edf20e1 100755
--- 
a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ 
b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -61,8 +61,9 @@ import org.apache.maven.scm.repository.ScmRepository;
         aggregator = true)
 public class CommonsDistributionStagingMojo extends AbstractMojo {
 
+    /** The name of file generated from the README.vm velocity template to be 
checked into the dist svn repo. */
     private static final String README_FILE_NAME = "README.html";
-
+    /** The name of file generated from the HEADER.vm velocity template to be 
checked into the dist svn repo. */
     private static final String HEADER_FILE_NAME = "HEADER.html";
 
     /**

Reply via email to