Skip to content
Permalink
Browse files
Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/commons-release-plugin.git

Conflicts:
	src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.java
  • Loading branch information
garydgregory committed May 18, 2018
2 parents 9ce2be1 + bef9b22 commit 2c2402c3a205e6e5409dcd8611da0c3a6ad1eedb
Showing 4 changed files with 52 additions and 48 deletions.
24 pom.xml
@@ -272,14 +272,22 @@
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.plugin.version}</version>
<configuration>
<enableRulesSummary>false</enableRulesSummary>
<configLocation>${basedir}/checkstyle.xml</configLocation>
<headerLocation>${basedir}/license-header.txt</headerLocation>
<suppressionsLocation>${basedir}/checkstyle-suppressions.xml</suppressionsLocation>
<suppressionsFileExpression>${basedir}/checkstyle-suppressions.xml</suppressionsFileExpression>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<configuration>
<configLocation>${basedir}/checkstyle.xml</configLocation>
<headerLocation>${basedir}/license-header.txt</headerLocation>
<suppressionsLocation>${basedir}/checkstyle-suppressions.xml</suppressionsLocation>
<suppressionsFileExpression>${basedir}/checkstyle-suppressions.xml</suppressionsFileExpression>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
@@ -21,7 +21,6 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@@ -175,8 +174,8 @@ private void putAttachedArtifactInSha1Map(Artifact artifact) throws MojoExecutio
+ "-"
+ artifact.getVersion()
+ " type: "
+ artifact.getType()
,e);
+ artifact.getType(),
e);
}
}

@@ -203,8 +202,8 @@ private void putAttachedArtifactInSha256Map(Artifact artifact) throws MojoExecut
+ "-"
+ artifact.getVersion()
+ " type: "
+ artifact.getType()
,e);
+ artifact.getType(),
e);
}
}

@@ -263,47 +262,39 @@ private void copyRemovedArtifactsToWorkingDirectory() throws MojoExecutionExcept
* the {@link CommonsDistributionStagingMojo}.
*
* @throws MojoExecutionException if some form of an {@link IOException} occurs, we want it
* properly wrapped so that Maven can handle it.
* properly wrapped so that maven can handle it.
*/
private void hashArtifacts() throws MojoExecutionException {
for (Artifact artifact : detachedArtifacts) {
if (!artifact.getFile().getName().contains("asc")) {
try {
{
// MD5
final String digest;
try (FileInputStream fis = new FileInputStream(artifact.getFile())) {
digest = DigestUtils.md5Hex(fis);
}
getLog().info(artifact.getFile().getName() + " md5: " + digest);
try (PrintWriter printWriter = new PrintWriter(
getMd5FilePath(workingDirectory, artifact.getFile()))) {
printWriter.println(digest);
}
// MD5
String digest;
try (FileInputStream fis = new FileInputStream(artifact.getFile())) {
digest = DigestUtils.md5Hex(fis);
}
getLog().info(artifact.getFile().getName() + " md5: " + digest);
try (PrintWriter printWriter = new PrintWriter(
getMd5FilePath(workingDirectory, artifact.getFile()))) {
printWriter.println(digest);
}
// SHA-1
try (FileInputStream fis = new FileInputStream(artifact.getFile())) {
digest = DigestUtils.sha1Hex(fis);
}
getLog().info(artifact.getFile().getName() + " sha1: " + digest);
try (PrintWriter printWriter = new PrintWriter(
getSha1FilePath(workingDirectory, artifact.getFile()))) {
printWriter.println(digest);
}
{
// SHA-1
final String digest;
try (FileInputStream fis = new FileInputStream(artifact.getFile())) {
digest = DigestUtils.sha1Hex(fis);
}
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);
}
{
// SHA-256
final String digest;
try (FileInputStream fis = new FileInputStream(artifact.getFile())) {
digest = DigestUtils.sha256Hex(fis);
}
getLog().info(artifact.getFile().getName() + " sha256: " + digest);
try (PrintWriter printWriter = new PrintWriter(
getSha256FilePath(workingDirectory, artifact.getFile()))) {
printWriter.println(digest);
}
getLog().info(artifact.getFile().getName() + " sha256: " + digest);
try (PrintWriter printWriter = new PrintWriter(
getSha256FilePath(workingDirectory, artifact.getFile()))) {
printWriter.println(digest);
}
} catch (IOException e) {
throw new MojoExecutionException("Could not sign file: " + artifact.getFile().getName(), e);
@@ -36,6 +36,7 @@ Maven artifacts are here:
These are the Maven artifacts and their hashes in Nexus:

@SHA1LIST@
@SHA256LIST@

(no need for .asc hashes!)

@@ -56,9 +56,12 @@
<!-- Create a temporary directory to load the template files into -->
<mkdir dir="${commonsMojoTempDir}"/>

<!-- Load SHA1 file created by the deploy goal -->
<!-- Load SHA-1 file created by the deploy goal -->
<loadfile property="commons.sha1list" srcFile="target/commons-release-plugin/sha1.properties"/>

<!-- Load SHA-256 file created by the deploy goal -->
<loadfile property="commons.sha256list" srcFile="target/commons-release-plugin/sha256.properties"/>

<!-- Load the vote-txt template from mojo resources to temp directory -->
<loadresource property="vote-txt">
<javaresource name="${commonsMojoXdocDir}/vote-txt-template.txt"/>
@@ -105,6 +108,7 @@
<filter token="RMKEY" value="${commons.releaseManagerKey}"/>
<filter token="RCREV" value="${svn.rc.revision}"/>
<filter token="SHA1LIST" value="${commons.sha1list}"/>
<filter token="SHA256LIST" value="${commons.sha256list}"/>
<filter token="DISTURL" value="${svn.dist.url}"/>
<filter token="TAGNAME" value="${git.tag.name}"/>
<filter token="TAGCOMMIT" value="${git.tag.commit}"/>

0 comments on commit 2c2402c

Please sign in to comment.