You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@commons.apache.org by ch...@apache.org on 2018/03/05 17:50:35 UTC
svn commit: r1026307 [2/11] - in
/websites/production/commons/content/proper/commons-release-plugin: ./
apidocs/ apidocs/org/apache/commons/release/plugin/
apidocs/org/apache/commons/release/plugin/class-use/
apidocs/org/apache/commons/release/plugin/m...
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/class-use/CommonsSiteCompressionMojo.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/class-use/CommonsSiteCompressionMojo.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/class-use/CommonsSiteCompressionMojo.html Mon Mar 5 17:50:33 2018
@@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Uses of Class org.apache.commons.release.plugin.mojos.CommonsSiteCompressionMojo (Apache Commons Release Plugin 1.1-SNAPSHOT API)</title>
+<title>Uses of Class org.apache.commons.release.plugin.mojos.CommonsSiteCompressionMojo (Apache Commons Release Plugin 1.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
@@ -12,7 +12,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Uses of Class org.apache.commons.release.plugin.mojos.CommonsSiteCompressionMojo (Apache Commons Release Plugin 1.1-SNAPSHOT API)";
+ parent.document.title="Uses of Class org.apache.commons.release.plugin.mojos.CommonsSiteCompressionMojo (Apache Commons Release Plugin 1.1 API)";
}
}
catch(err) {
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/package-frame.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/package-frame.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/package-frame.html Mon Mar 5 17:50:33 2018
@@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>org.apache.commons.release.plugin.mojos (Apache Commons Release Plugin 1.1-SNAPSHOT API)</title>
+<title>org.apache.commons.release.plugin.mojos (Apache Commons Release Plugin 1.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/package-summary.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/package-summary.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/package-summary.html Mon Mar 5 17:50:33 2018
@@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>org.apache.commons.release.plugin.mojos (Apache Commons Release Plugin 1.1-SNAPSHOT API)</title>
+<title>org.apache.commons.release.plugin.mojos (Apache Commons Release Plugin 1.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
@@ -12,7 +12,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="org.apache.commons.release.plugin.mojos (Apache Commons Release Plugin 1.1-SNAPSHOT API)";
+ parent.document.title="org.apache.commons.release.plugin.mojos (Apache Commons Release Plugin 1.1 API)";
}
}
catch(err) {
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/package-tree.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/package-tree.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/package-tree.html Mon Mar 5 17:50:33 2018
@@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>org.apache.commons.release.plugin.mojos Class Hierarchy (Apache Commons Release Plugin 1.1-SNAPSHOT API)</title>
+<title>org.apache.commons.release.plugin.mojos Class Hierarchy (Apache Commons Release Plugin 1.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
@@ -12,7 +12,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="org.apache.commons.release.plugin.mojos Class Hierarchy (Apache Commons Release Plugin 1.1-SNAPSHOT API)";
+ parent.document.title="org.apache.commons.release.plugin.mojos Class Hierarchy (Apache Commons Release Plugin 1.1 API)";
}
}
catch(err) {
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/package-use.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/package-use.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/mojos/package-use.html Mon Mar 5 17:50:33 2018
@@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Uses of Package org.apache.commons.release.plugin.mojos (Apache Commons Release Plugin 1.1-SNAPSHOT API)</title>
+<title>Uses of Package org.apache.commons.release.plugin.mojos (Apache Commons Release Plugin 1.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
@@ -12,7 +12,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Uses of Package org.apache.commons.release.plugin.mojos (Apache Commons Release Plugin 1.1-SNAPSHOT API)";
+ parent.document.title="Uses of Package org.apache.commons.release.plugin.mojos (Apache Commons Release Plugin 1.1 API)";
}
}
catch(err) {
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/package-frame.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/package-frame.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/package-frame.html Mon Mar 5 17:50:33 2018
@@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>org.apache.commons.release.plugin (Apache Commons Release Plugin 1.1-SNAPSHOT API)</title>
+<title>org.apache.commons.release.plugin (Apache Commons Release Plugin 1.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/package-summary.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/package-summary.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/package-summary.html Mon Mar 5 17:50:33 2018
@@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>org.apache.commons.release.plugin (Apache Commons Release Plugin 1.1-SNAPSHOT API)</title>
+<title>org.apache.commons.release.plugin (Apache Commons Release Plugin 1.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
@@ -12,7 +12,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="org.apache.commons.release.plugin (Apache Commons Release Plugin 1.1-SNAPSHOT API)";
+ parent.document.title="org.apache.commons.release.plugin (Apache Commons Release Plugin 1.1 API)";
}
}
catch(err) {
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/package-tree.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/package-tree.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/package-tree.html Mon Mar 5 17:50:33 2018
@@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>org.apache.commons.release.plugin Class Hierarchy (Apache Commons Release Plugin 1.1-SNAPSHOT API)</title>
+<title>org.apache.commons.release.plugin Class Hierarchy (Apache Commons Release Plugin 1.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
@@ -12,7 +12,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="org.apache.commons.release.plugin Class Hierarchy (Apache Commons Release Plugin 1.1-SNAPSHOT API)";
+ parent.document.title="org.apache.commons.release.plugin Class Hierarchy (Apache Commons Release Plugin 1.1 API)";
}
}
catch(err) {
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/package-use.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/package-use.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/org/apache/commons/release/plugin/package-use.html Mon Mar 5 17:50:33 2018
@@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Uses of Package org.apache.commons.release.plugin (Apache Commons Release Plugin 1.1-SNAPSHOT API)</title>
+<title>Uses of Package org.apache.commons.release.plugin (Apache Commons Release Plugin 1.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
@@ -12,7 +12,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Uses of Package org.apache.commons.release.plugin (Apache Commons Release Plugin 1.1-SNAPSHOT API)";
+ parent.document.title="Uses of Package org.apache.commons.release.plugin (Apache Commons Release Plugin 1.1 API)";
}
}
catch(err) {
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/overview-frame.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/overview-frame.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/overview-frame.html Mon Mar 5 17:50:33 2018
@@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Overview List (Apache Commons Release Plugin 1.1-SNAPSHOT API)</title>
+<title>Overview List (Apache Commons Release Plugin 1.1 API)</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/overview-summary.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/overview-summary.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/overview-summary.html Mon Mar 5 17:50:33 2018
@@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Overview (Apache Commons Release Plugin 1.1-SNAPSHOT API)</title>
+<title>Overview (Apache Commons Release Plugin 1.1 API)</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
@@ -12,7 +12,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Overview (Apache Commons Release Plugin 1.1-SNAPSHOT API)";
+ parent.document.title="Overview (Apache Commons Release Plugin 1.1 API)";
}
}
catch(err) {
@@ -70,7 +70,7 @@
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
-<h1 class="title">Apache Commons Release Plugin 1.1-SNAPSHOT API</h1>
+<h1 class="title">Apache Commons Release Plugin 1.1 API</h1>
</div>
<div class="contentContainer">
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Packages table, listing packages, and an explanation">
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/overview-tree.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/overview-tree.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/overview-tree.html Mon Mar 5 17:50:33 2018
@@ -4,7 +4,7 @@
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Class Hierarchy (Apache Commons Release Plugin 1.1-SNAPSHOT API)</title>
+<title>Class Hierarchy (Apache Commons Release Plugin 1.1 API)</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
@@ -12,7 +12,7 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="Class Hierarchy (Apache Commons Release Plugin 1.1-SNAPSHOT API)";
+ parent.document.title="Class Hierarchy (Apache Commons Release Plugin 1.1 API)";
}
}
catch(err) {
Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/src-html/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/src-html/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/src-html/org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo.html Mon Mar 5 17:50:33 2018
@@ -24,178 +24,202 @@
<span class="sourceLineNo">016</span> */<a name="line.16"></a>
<span class="sourceLineNo">017</span>package org.apache.commons.release.plugin.mojos;<a name="line.17"></a>
<span class="sourceLineNo">018</span><a name="line.18"></a>
-<span class="sourceLineNo">019</span>import org.apache.commons.codec.digest.DigestUtils;<a name="line.19"></a>
-<span class="sourceLineNo">020</span>import org.apache.commons.release.plugin.SharedFunctions;<a name="line.20"></a>
-<span class="sourceLineNo">021</span>import org.apache.maven.plugin.AbstractMojo;<a name="line.21"></a>
-<span class="sourceLineNo">022</span>import org.apache.maven.plugin.MojoExecutionException;<a name="line.22"></a>
-<span class="sourceLineNo">023</span>import org.apache.maven.plugins.annotations.LifecyclePhase;<a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.apache.maven.plugins.annotations.Mojo;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.maven.plugins.annotations.Parameter;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.maven.project.MavenProject;<a name="line.26"></a>
-<span class="sourceLineNo">027</span>import org.apache.maven.artifact.Artifact;<a name="line.27"></a>
-<span class="sourceLineNo">028</span><a name="line.28"></a>
-<span class="sourceLineNo">029</span>import java.io.File;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import java.io.FileInputStream;<a name="line.30"></a>
-<span class="sourceLineNo">031</span>import java.io.IOException;<a name="line.31"></a>
-<span class="sourceLineNo">032</span>import java.io.PrintWriter;<a name="line.32"></a>
-<span class="sourceLineNo">033</span>import java.util.ArrayList;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>import java.util.Collections;<a name="line.34"></a>
-<span class="sourceLineNo">035</span>import java.util.HashSet;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>import java.util.List;<a name="line.36"></a>
-<span class="sourceLineNo">037</span>import java.util.Set;<a name="line.37"></a>
-<span class="sourceLineNo">038</span><a name="line.38"></a>
-<span class="sourceLineNo">039</span>/**<a name="line.39"></a>
-<span class="sourceLineNo">040</span> * The purpose of this maven mojo is to detach the artifacts generated by the maven-assembly-plugin,<a name="line.40"></a>
-<span class="sourceLineNo">041</span> * which for the Apache Commons Project do not get uploaded to Nexus, and putting those artifacts<a name="line.41"></a>
-<span class="sourceLineNo">042</span> * in the dev distribution location for apache projects.<a name="line.42"></a>
-<span class="sourceLineNo">043</span> *<a name="line.43"></a>
-<span class="sourceLineNo">044</span> * @author chtompki<a name="line.44"></a>
-<span class="sourceLineNo">045</span> * @since 1.0<a name="line.45"></a>
-<span class="sourceLineNo">046</span> */<a name="line.46"></a>
-<span class="sourceLineNo">047</span>@Mojo(name = "detach-distributions", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true)<a name="line.47"></a>
-<span class="sourceLineNo">048</span>public class CommonsDistributionDetachmentMojo extends AbstractMojo {<a name="line.48"></a>
-<span class="sourceLineNo">049</span><a name="line.49"></a>
-<span class="sourceLineNo">050</span> /**<a name="line.50"></a>
-<span class="sourceLineNo">051</span> * A list of "artifact types" in the maven vernacular, to<a name="line.51"></a>
-<span class="sourceLineNo">052</span> * be detached from the deployment. For the time being we want<a name="line.52"></a>
-<span class="sourceLineNo">053</span> * all artifacts generated by the maven-assembly-plugin to be detatched<a name="line.53"></a>
-<span class="sourceLineNo">054</span> * from the deployment, namely *-src.zip, *-src.tar.gz, *-bin.zip,<a name="line.54"></a>
-<span class="sourceLineNo">055</span> * *-bin.tar.gz, and the corresponding .asc pgp signatures.<a name="line.55"></a>
-<span class="sourceLineNo">056</span> */<a name="line.56"></a>
-<span class="sourceLineNo">057</span> private static final Set<String> ARTIFACT_TYPES_TO_DETATCH;<a name="line.57"></a>
-<span class="sourceLineNo">058</span> static {<a name="line.58"></a>
-<span class="sourceLineNo">059</span> Set<String> hashSet = new HashSet<>();<a name="line.59"></a>
-<span class="sourceLineNo">060</span> hashSet.add("zip");<a name="line.60"></a>
-<span class="sourceLineNo">061</span> hashSet.add("tar.gz");<a name="line.61"></a>
-<span class="sourceLineNo">062</span> hashSet.add("zip.asc");<a name="line.62"></a>
-<span class="sourceLineNo">063</span> hashSet.add("tar.gz.asc");<a name="line.63"></a>
-<span class="sourceLineNo">064</span> ARTIFACT_TYPES_TO_DETATCH = Collections.unmodifiableSet(hashSet);<a name="line.64"></a>
-<span class="sourceLineNo">065</span> }<a name="line.65"></a>
-<span class="sourceLineNo">066</span><a name="line.66"></a>
-<span class="sourceLineNo">067</span> /**<a name="line.67"></a>
-<span class="sourceLineNo">068</span> * This list is supposed to hold the maven references to the aformentioned artifacts so that we<a name="line.68"></a>
-<span class="sourceLineNo">069</span> * can upload them to svn after they've been detatched from the maven deployment.<a name="line.69"></a>
-<span class="sourceLineNo">070</span> */<a name="line.70"></a>
-<span class="sourceLineNo">071</span> private List<Artifact> detatchedArtifacts = new ArrayList<>();<a name="line.71"></a>
-<span class="sourceLineNo">072</span><a name="line.72"></a>
-<span class="sourceLineNo">073</span> /**<a name="line.73"></a>
-<span class="sourceLineNo">074</span> * The maven project context injection so that we can get a hold of the variables at hand.<a name="line.74"></a>
+<span class="sourceLineNo">019</span>import java.nio.file.Files;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import org.apache.commons.codec.digest.DigestUtils;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import org.apache.commons.lang3.StringUtils;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import org.apache.commons.release.plugin.SharedFunctions;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import org.apache.maven.plugin.AbstractMojo;<a name="line.23"></a>
+<span class="sourceLineNo">024</span>import org.apache.maven.plugin.MojoExecutionException;<a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.maven.plugins.annotations.LifecyclePhase;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.maven.plugins.annotations.Mojo;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.maven.plugins.annotations.Parameter;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.maven.project.MavenProject;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.maven.artifact.Artifact;<a name="line.29"></a>
+<span class="sourceLineNo">030</span><a name="line.30"></a>
+<span class="sourceLineNo">031</span>import java.io.File;<a name="line.31"></a>
+<span class="sourceLineNo">032</span>import java.io.FileInputStream;<a name="line.32"></a>
+<span class="sourceLineNo">033</span>import java.io.IOException;<a name="line.33"></a>
+<span class="sourceLineNo">034</span>import java.io.PrintWriter;<a name="line.34"></a>
+<span class="sourceLineNo">035</span>import java.util.ArrayList;<a name="line.35"></a>
+<span class="sourceLineNo">036</span>import java.util.Collections;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>import java.util.HashSet;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>import java.util.List;<a name="line.38"></a>
+<span class="sourceLineNo">039</span>import java.util.Set;<a name="line.39"></a>
+<span class="sourceLineNo">040</span><a name="line.40"></a>
+<span class="sourceLineNo">041</span>/**<a name="line.41"></a>
+<span class="sourceLineNo">042</span> * The purpose of this maven mojo is to detach the artifacts generated by the maven-assembly-plugin,<a name="line.42"></a>
+<span class="sourceLineNo">043</span> * which for the Apache Commons Project do not get uploaded to Nexus, and putting those artifacts<a name="line.43"></a>
+<span class="sourceLineNo">044</span> * in the dev distribution location for apache projects.<a name="line.44"></a>
+<span class="sourceLineNo">045</span> *<a name="line.45"></a>
+<span class="sourceLineNo">046</span> * @author chtompki<a name="line.46"></a>
+<span class="sourceLineNo">047</span> * @since 1.0<a name="line.47"></a>
+<span class="sourceLineNo">048</span> */<a name="line.48"></a>
+<span class="sourceLineNo">049</span>@Mojo(name = "detach-distributions",<a name="line.49"></a>
+<span class="sourceLineNo">050</span> defaultPhase = LifecyclePhase.VERIFY,<a name="line.50"></a>
+<span class="sourceLineNo">051</span> threadSafe = true,<a name="line.51"></a>
+<span class="sourceLineNo">052</span> aggregator = true)<a name="line.52"></a>
+<span class="sourceLineNo">053</span>public class CommonsDistributionDetachmentMojo extends AbstractMojo {<a name="line.53"></a>
+<span class="sourceLineNo">054</span><a name="line.54"></a>
+<span class="sourceLineNo">055</span> /**<a name="line.55"></a>
+<span class="sourceLineNo">056</span> * A list of "artifact types" in the maven vernacular, to<a name="line.56"></a>
+<span class="sourceLineNo">057</span> * be detached from the deployment. For the time being we want<a name="line.57"></a>
+<span class="sourceLineNo">058</span> * all artifacts generated by the maven-assembly-plugin to be detached<a name="line.58"></a>
+<span class="sourceLineNo">059</span> * from the deployment, namely *-src.zip, *-src.tar.gz, *-bin.zip,<a name="line.59"></a>
+<span class="sourceLineNo">060</span> * *-bin.tar.gz, and the corresponding .asc pgp signatures.<a name="line.60"></a>
+<span class="sourceLineNo">061</span> */<a name="line.61"></a>
+<span class="sourceLineNo">062</span> private static final Set<String> ARTIFACT_TYPES_TO_DETACH;<a name="line.62"></a>
+<span class="sourceLineNo">063</span> static {<a name="line.63"></a>
+<span class="sourceLineNo">064</span> Set<String> hashSet = new HashSet<>();<a name="line.64"></a>
+<span class="sourceLineNo">065</span> hashSet.add("zip");<a name="line.65"></a>
+<span class="sourceLineNo">066</span> hashSet.add("tar.gz");<a name="line.66"></a>
+<span class="sourceLineNo">067</span> hashSet.add("zip.asc");<a name="line.67"></a>
+<span class="sourceLineNo">068</span> hashSet.add("tar.gz.asc");<a name="line.68"></a>
+<span class="sourceLineNo">069</span> ARTIFACT_TYPES_TO_DETACH = Collections.unmodifiableSet(hashSet);<a name="line.69"></a>
+<span class="sourceLineNo">070</span> }<a name="line.70"></a>
+<span class="sourceLineNo">071</span><a name="line.71"></a>
+<span class="sourceLineNo">072</span> /**<a name="line.72"></a>
+<span class="sourceLineNo">073</span> * This list is supposed to hold the maven references to the aformentioned artifacts so that we<a name="line.73"></a>
+<span class="sourceLineNo">074</span> * can upload them to svn after they've been detached from the maven deployment.<a name="line.74"></a>
<span class="sourceLineNo">075</span> */<a name="line.75"></a>
-<span class="sourceLineNo">076</span> @Parameter(defaultValue = "${project}", required = true)<a name="line.76"></a>
-<span class="sourceLineNo">077</span> private MavenProject project;<a name="line.77"></a>
-<span class="sourceLineNo">078</span><a name="line.78"></a>
-<span class="sourceLineNo">079</span> /**<a name="line.79"></a>
-<span class="sourceLineNo">080</span> * The working directory in <code>target</code> that we use as a sandbox for the plugin.<a name="line.80"></a>
-<span class="sourceLineNo">081</span> */<a name="line.81"></a>
-<span class="sourceLineNo">082</span> @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory")<a name="line.82"></a>
-<span class="sourceLineNo">083</span> private File workingDirectory;<a name="line.83"></a>
-<span class="sourceLineNo">084</span><a name="line.84"></a>
-<span class="sourceLineNo">085</span> /**<a name="line.85"></a>
-<span class="sourceLineNo">086</span> * The subversion staging url to which we upload all of our staged artifacts.<a name="line.86"></a>
-<span class="sourceLineNo">087</span> */<a name="line.87"></a>
-<span class="sourceLineNo">088</span> @Parameter(required = true)<a name="line.88"></a>
-<span class="sourceLineNo">089</span> private String distSvnStagingUrl;<a name="line.89"></a>
+<span class="sourceLineNo">076</span> private List<Artifact> detachedArtifacts = new ArrayList<>();<a name="line.76"></a>
+<span class="sourceLineNo">077</span><a name="line.77"></a>
+<span class="sourceLineNo">078</span> /**<a name="line.78"></a>
+<span class="sourceLineNo">079</span> * The maven project context injection so that we can get a hold of the variables at hand.<a name="line.79"></a>
+<span class="sourceLineNo">080</span> */<a name="line.80"></a>
+<span class="sourceLineNo">081</span> @Parameter(defaultValue = "${project}", required = true)<a name="line.81"></a>
+<span class="sourceLineNo">082</span> private MavenProject project;<a name="line.82"></a>
+<span class="sourceLineNo">083</span><a name="line.83"></a>
+<span class="sourceLineNo">084</span> /**<a name="line.84"></a>
+<span class="sourceLineNo">085</span> * The working directory in <code>target</code> that we use as a sandbox for the plugin.<a name="line.85"></a>
+<span class="sourceLineNo">086</span> */<a name="line.86"></a>
+<span class="sourceLineNo">087</span> @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin",<a name="line.87"></a>
+<span class="sourceLineNo">088</span> property = "commons.outputDirectory")<a name="line.88"></a>
+<span class="sourceLineNo">089</span> private File workingDirectory;<a name="line.89"></a>
<span class="sourceLineNo">090</span><a name="line.90"></a>
-<span class="sourceLineNo">091</span> @Override<a name="line.91"></a>
-<span class="sourceLineNo">092</span> public void execute() throws MojoExecutionException {<a name="line.92"></a>
-<span class="sourceLineNo">093</span> getLog().info("Detatching Assemblies");<a name="line.93"></a>
-<span class="sourceLineNo">094</span> for (Object attachedArtifact : project.getAttachedArtifacts()) {<a name="line.94"></a>
-<span class="sourceLineNo">095</span> if (ARTIFACT_TYPES_TO_DETATCH.contains(((Artifact) attachedArtifact).getType())) {<a name="line.95"></a>
-<span class="sourceLineNo">096</span> detatchedArtifacts.add((Artifact) attachedArtifact);<a name="line.96"></a>
-<span class="sourceLineNo">097</span> }<a name="line.97"></a>
-<span class="sourceLineNo">098</span> }<a name="line.98"></a>
-<span class="sourceLineNo">099</span> for (Artifact artifactToRemove : detatchedArtifacts) {<a name="line.99"></a>
-<span class="sourceLineNo">100</span> project.getAttachedArtifacts().remove(artifactToRemove);<a name="line.100"></a>
-<span class="sourceLineNo">101</span> }<a name="line.101"></a>
-<span class="sourceLineNo">102</span> if (!workingDirectory.exists()) {<a name="line.102"></a>
-<span class="sourceLineNo">103</span> SharedFunctions.initDirectory(getLog(), workingDirectory);<a name="line.103"></a>
-<span class="sourceLineNo">104</span> }<a name="line.104"></a>
-<span class="sourceLineNo">105</span> copyRemovedArtifactsToWorkingDirectory();<a name="line.105"></a>
-<span class="sourceLineNo">106</span> getLog().info("");<a name="line.106"></a>
-<span class="sourceLineNo">107</span> sha1AndMd5SignArtifacts();<a name="line.107"></a>
-<span class="sourceLineNo">108</span> }<a name="line.108"></a>
-<span class="sourceLineNo">109</span><a name="line.109"></a>
-<span class="sourceLineNo">110</span> /**<a name="line.110"></a>
-<span class="sourceLineNo">111</span> * A helper method to copy the newly detached artifacts to <code>target/commons-release-plugin</code><a name="line.111"></a>
-<span class="sourceLineNo">112</span> * so that the {@link CommonsDistributionStagingMojo} can find the artifacts later.<a name="line.112"></a>
-<span class="sourceLineNo">113</span> *<a name="line.113"></a>
-<span class="sourceLineNo">114</span> * @throws MojoExecutionException if some form of an {@link IOException} occurs, we want it<a name="line.114"></a>
-<span class="sourceLineNo">115</span> * properly wrapped so that maven can handle it.<a name="line.115"></a>
-<span class="sourceLineNo">116</span> */<a name="line.116"></a>
-<span class="sourceLineNo">117</span> private void copyRemovedArtifactsToWorkingDirectory() throws MojoExecutionException {<a name="line.117"></a>
-<span class="sourceLineNo">118</span> StringBuffer copiedArtifactAbsolutePath;<a name="line.118"></a>
-<span class="sourceLineNo">119</span> getLog().info("Copying detatched artifacts to working directory.");<a name="line.119"></a>
-<span class="sourceLineNo">120</span> for (Artifact artifact: detatchedArtifacts) {<a name="line.120"></a>
-<span class="sourceLineNo">121</span> File artifactFile = artifact.getFile();<a name="line.121"></a>
-<span class="sourceLineNo">122</span> copiedArtifactAbsolutePath = new StringBuffer(workingDirectory.getAbsolutePath());<a name="line.122"></a>
-<span class="sourceLineNo">123</span> copiedArtifactAbsolutePath.append("/");<a name="line.123"></a>
-<span class="sourceLineNo">124</span> copiedArtifactAbsolutePath.append(artifactFile.getName());<a name="line.124"></a>
-<span class="sourceLineNo">125</span> File copiedArtifact = new File(copiedArtifactAbsolutePath.toString());<a name="line.125"></a>
-<span class="sourceLineNo">126</span> getLog().info("Copying: " + artifactFile.getName());<a name="line.126"></a>
-<span class="sourceLineNo">127</span> SharedFunctions.copyFile(getLog(), artifactFile, copiedArtifact);<a name="line.127"></a>
-<span class="sourceLineNo">128</span> }<a name="line.128"></a>
-<span class="sourceLineNo">129</span> }<a name="line.129"></a>
-<span class="sourceLineNo">130</span><a name="line.130"></a>
-<span class="sourceLineNo">131</span> /**<a name="line.131"></a>
-<span class="sourceLineNo">132</span> * A helper method that creates md5 and sha1 signature files for our detached artifacts in the<a name="line.132"></a>
-<span class="sourceLineNo">133</span> * <code>target/commons-release-plugin</code> directory for the purpose of being uploade by<a name="line.133"></a>
-<span class="sourceLineNo">134</span> * the {@link CommonsDistributionStagingMojo}.<a name="line.134"></a>
-<span class="sourceLineNo">135</span> *<a name="line.135"></a>
-<span class="sourceLineNo">136</span> * @throws MojoExecutionException if some form of an {@link IOException} occurs, we want it<a name="line.136"></a>
-<span class="sourceLineNo">137</span> * properly wrapped so that maven can handle it.<a name="line.137"></a>
-<span class="sourceLineNo">138</span> */<a name="line.138"></a>
-<span class="sourceLineNo">139</span> private void sha1AndMd5SignArtifacts() throws MojoExecutionException {<a name="line.139"></a>
-<span class="sourceLineNo">140</span> for (Artifact artifact : detatchedArtifacts) {<a name="line.140"></a>
-<span class="sourceLineNo">141</span> if (!artifact.getFile().getName().contains("asc")) {<a name="line.141"></a>
-<span class="sourceLineNo">142</span> try {<a name="line.142"></a>
-<span class="sourceLineNo">143</span> FileInputStream artifactFileInputStream = new FileInputStream(artifact.getFile());<a name="line.143"></a>
-<span class="sourceLineNo">144</span> String md5 = DigestUtils.md5Hex(artifactFileInputStream);<a name="line.144"></a>
-<span class="sourceLineNo">145</span> getLog().info(artifact.getFile().getName() + " md5: " + md5);<a name="line.145"></a>
-<span class="sourceLineNo">146</span> PrintWriter md5Writer = new PrintWriter(getMd5FilePath(workingDirectory, artifact.getFile()));<a name="line.146"></a>
-<span class="sourceLineNo">147</span> md5Writer.println(md5);<a name="line.147"></a>
-<span class="sourceLineNo">148</span> String sha1 = DigestUtils.sha1Hex(artifactFileInputStream);<a name="line.148"></a>
-<span class="sourceLineNo">149</span> getLog().info(artifact.getFile().getName() + " sha1: " + sha1);<a name="line.149"></a>
-<span class="sourceLineNo">150</span> PrintWriter sha1Writer = new PrintWriter(getSha1FilePath(workingDirectory, artifact.getFile()));<a name="line.150"></a>
-<span class="sourceLineNo">151</span> sha1Writer.println(sha1);<a name="line.151"></a>
-<span class="sourceLineNo">152</span> md5Writer.close();<a name="line.152"></a>
-<span class="sourceLineNo">153</span> sha1Writer.close();<a name="line.153"></a>
-<span class="sourceLineNo">154</span> } catch (IOException e) {<a name="line.154"></a>
-<span class="sourceLineNo">155</span> throw new MojoExecutionException("Could not sign file: " + artifact.getFile().getName(), e);<a name="line.155"></a>
-<span class="sourceLineNo">156</span> }<a name="line.156"></a>
-<span class="sourceLineNo">157</span> }<a name="line.157"></a>
-<span class="sourceLineNo">158</span> }<a name="line.158"></a>
-<span class="sourceLineNo">159</span> }<a name="line.159"></a>
-<span class="sourceLineNo">160</span><a name="line.160"></a>
-<span class="sourceLineNo">161</span> /**<a name="line.161"></a>
-<span class="sourceLineNo">162</span> * A helper method to create a file path for the <code>md5</code> signature file from a given file.<a name="line.162"></a>
-<span class="sourceLineNo">163</span> *<a name="line.163"></a>
-<span class="sourceLineNo">164</span> * @param workingDirectory is the {@link File} for the directory in which to make the <code>.md5</code> file.<a name="line.164"></a>
-<span class="sourceLineNo">165</span> * @param file the {@link File} whose name we should use to create the <code>.md5</code> file.<a name="line.165"></a>
-<span class="sourceLineNo">166</span> * @return a {@link String} that is the absolute path to the <code>.md5</code> file.<a name="line.166"></a>
-<span class="sourceLineNo">167</span> */<a name="line.167"></a>
-<span class="sourceLineNo">168</span> private String getMd5FilePath(File workingDirectory, File file) {<a name="line.168"></a>
-<span class="sourceLineNo">169</span> StringBuffer buffer = new StringBuffer(workingDirectory.getAbsolutePath());<a name="line.169"></a>
-<span class="sourceLineNo">170</span> buffer.append("/");<a name="line.170"></a>
-<span class="sourceLineNo">171</span> buffer.append(file.getName());<a name="line.171"></a>
-<span class="sourceLineNo">172</span> buffer.append(".md5");<a name="line.172"></a>
-<span class="sourceLineNo">173</span> return buffer.toString();<a name="line.173"></a>
-<span class="sourceLineNo">174</span> }<a name="line.174"></a>
-<span class="sourceLineNo">175</span><a name="line.175"></a>
-<span class="sourceLineNo">176</span> /**<a name="line.176"></a>
-<span class="sourceLineNo">177</span> * A helper method to create a file path for the <code>sha1</code> signature file from a given file.<a name="line.177"></a>
-<span class="sourceLineNo">178</span> *<a name="line.178"></a>
-<span class="sourceLineNo">179</span> * @param workingDirectory is the {@link File} for the directory in which to make the <code>.sha1</code> file.<a name="line.179"></a>
-<span class="sourceLineNo">180</span> * @param file the {@link File} whose name we should use to create the <code>.sha1</code> file.<a name="line.180"></a>
-<span class="sourceLineNo">181</span> * @return a {@link String} that is the absolute path to the <code>.sha1</code> file.<a name="line.181"></a>
-<span class="sourceLineNo">182</span> */<a name="line.182"></a>
-<span class="sourceLineNo">183</span> private String getSha1FilePath(File workingDirectory, File file) {<a name="line.183"></a>
-<span class="sourceLineNo">184</span> StringBuffer buffer = new StringBuffer(workingDirectory.getAbsolutePath());<a name="line.184"></a>
-<span class="sourceLineNo">185</span> buffer.append("/");<a name="line.185"></a>
-<span class="sourceLineNo">186</span> buffer.append(file.getName());<a name="line.186"></a>
-<span class="sourceLineNo">187</span> buffer.append(".sha1");<a name="line.187"></a>
-<span class="sourceLineNo">188</span> return buffer.toString();<a name="line.188"></a>
-<span class="sourceLineNo">189</span> }<a name="line.189"></a>
-<span class="sourceLineNo">190</span>}<a name="line.190"></a>
+<span class="sourceLineNo">091</span> /**<a name="line.91"></a>
+<span class="sourceLineNo">092</span> * The subversion staging url to which we upload all of our staged artifacts.<a name="line.92"></a>
+<span class="sourceLineNo">093</span> */<a name="line.93"></a>
+<span class="sourceLineNo">094</span> @Parameter(defaultValue = "", property = "commons.distSvnStagingUrl")<a name="line.94"></a>
+<span class="sourceLineNo">095</span> private String distSvnStagingUrl;<a name="line.95"></a>
+<span class="sourceLineNo">096</span><a name="line.96"></a>
+<span class="sourceLineNo">097</span> /**<a name="line.97"></a>
+<span class="sourceLineNo">098</span> * A parameter to generally avoid running unless it is specifically turned on by the consuming module.<a name="line.98"></a>
+<span class="sourceLineNo">099</span> */<a name="line.99"></a>
+<span class="sourceLineNo">100</span> @Parameter(defaultValue = "false", property = "commons.release.isDistModule")<a name="line.100"></a>
+<span class="sourceLineNo">101</span> private Boolean isDistModule;<a name="line.101"></a>
+<span class="sourceLineNo">102</span><a name="line.102"></a>
+<span class="sourceLineNo">103</span> @Override<a name="line.103"></a>
+<span class="sourceLineNo">104</span> public void execute() throws MojoExecutionException {<a name="line.104"></a>
+<span class="sourceLineNo">105</span> if (!isDistModule) {<a name="line.105"></a>
+<span class="sourceLineNo">106</span> getLog().info("This module is marked as a non distribution " +<a name="line.106"></a>
+<span class="sourceLineNo">107</span> "or assembly module, and the plugin will not run.");<a name="line.107"></a>
+<span class="sourceLineNo">108</span> return;<a name="line.108"></a>
+<span class="sourceLineNo">109</span> }<a name="line.109"></a>
+<span class="sourceLineNo">110</span> if (StringUtils.isEmpty(distSvnStagingUrl)) {<a name="line.110"></a>
+<span class="sourceLineNo">111</span> getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run.");<a name="line.111"></a>
+<span class="sourceLineNo">112</span> return;<a name="line.112"></a>
+<span class="sourceLineNo">113</span> }<a name="line.113"></a>
+<span class="sourceLineNo">114</span> getLog().info("Detaching Assemblies");<a name="line.114"></a>
+<span class="sourceLineNo">115</span> for (Object attachedArtifact : project.getAttachedArtifacts()) {<a name="line.115"></a>
+<span class="sourceLineNo">116</span> if (ARTIFACT_TYPES_TO_DETACH.contains(((Artifact) attachedArtifact).getType())) {<a name="line.116"></a>
+<span class="sourceLineNo">117</span> detachedArtifacts.add((Artifact) attachedArtifact);<a name="line.117"></a>
+<span class="sourceLineNo">118</span> }<a name="line.118"></a>
+<span class="sourceLineNo">119</span> }<a name="line.119"></a>
+<span class="sourceLineNo">120</span> if (detachedArtifacts.isEmpty()) {<a name="line.120"></a>
+<span class="sourceLineNo">121</span> getLog().info("Current project contains no distributions. Not executing.");<a name="line.121"></a>
+<span class="sourceLineNo">122</span> return;<a name="line.122"></a>
+<span class="sourceLineNo">123</span> }<a name="line.123"></a>
+<span class="sourceLineNo">124</span> for (Artifact artifactToRemove : detachedArtifacts) {<a name="line.124"></a>
+<span class="sourceLineNo">125</span> project.getAttachedArtifacts().remove(artifactToRemove);<a name="line.125"></a>
+<span class="sourceLineNo">126</span> }<a name="line.126"></a>
+<span class="sourceLineNo">127</span> if (!workingDirectory.exists()) {<a name="line.127"></a>
+<span class="sourceLineNo">128</span> SharedFunctions.initDirectory(getLog(), workingDirectory);<a name="line.128"></a>
+<span class="sourceLineNo">129</span> }<a name="line.129"></a>
+<span class="sourceLineNo">130</span> copyRemovedArtifactsToWorkingDirectory();<a name="line.130"></a>
+<span class="sourceLineNo">131</span> getLog().info("");<a name="line.131"></a>
+<span class="sourceLineNo">132</span> sha1AndMd5SignArtifacts();<a name="line.132"></a>
+<span class="sourceLineNo">133</span> }<a name="line.133"></a>
+<span class="sourceLineNo">134</span><a name="line.134"></a>
+<span class="sourceLineNo">135</span> /**<a name="line.135"></a>
+<span class="sourceLineNo">136</span> * A helper method to copy the newly detached artifacts to <code>target/commons-release-plugin</code><a name="line.136"></a>
+<span class="sourceLineNo">137</span> * so that the {@link CommonsDistributionStagingMojo} can find the artifacts later.<a name="line.137"></a>
+<span class="sourceLineNo">138</span> *<a name="line.138"></a>
+<span class="sourceLineNo">139</span> * @throws MojoExecutionException if some form of an {@link IOException} occurs, we want it<a name="line.139"></a>
+<span class="sourceLineNo">140</span> * properly wrapped so that maven can handle it.<a name="line.140"></a>
+<span class="sourceLineNo">141</span> */<a name="line.141"></a>
+<span class="sourceLineNo">142</span> private void copyRemovedArtifactsToWorkingDirectory() throws MojoExecutionException {<a name="line.142"></a>
+<span class="sourceLineNo">143</span> StringBuffer copiedArtifactAbsolutePath;<a name="line.143"></a>
+<span class="sourceLineNo">144</span> getLog().info("Copying detached artifacts to working directory.");<a name="line.144"></a>
+<span class="sourceLineNo">145</span> for (Artifact artifact: detachedArtifacts) {<a name="line.145"></a>
+<span class="sourceLineNo">146</span> File artifactFile = artifact.getFile();<a name="line.146"></a>
+<span class="sourceLineNo">147</span> copiedArtifactAbsolutePath = new StringBuffer(workingDirectory.getAbsolutePath());<a name="line.147"></a>
+<span class="sourceLineNo">148</span> copiedArtifactAbsolutePath.append("/");<a name="line.148"></a>
+<span class="sourceLineNo">149</span> copiedArtifactAbsolutePath.append(artifactFile.getName());<a name="line.149"></a>
+<span class="sourceLineNo">150</span> File copiedArtifact = new File(copiedArtifactAbsolutePath.toString());<a name="line.150"></a>
+<span class="sourceLineNo">151</span> getLog().info("Copying: " + artifactFile.getName());<a name="line.151"></a>
+<span class="sourceLineNo">152</span> SharedFunctions.copyFile(getLog(), artifactFile, copiedArtifact);<a name="line.152"></a>
+<span class="sourceLineNo">153</span> }<a name="line.153"></a>
+<span class="sourceLineNo">154</span> }<a name="line.154"></a>
+<span class="sourceLineNo">155</span><a name="line.155"></a>
+<span class="sourceLineNo">156</span> /**<a name="line.156"></a>
+<span class="sourceLineNo">157</span> * A helper method that creates md5 and sha1 signature files for our detached artifacts in the<a name="line.157"></a>
+<span class="sourceLineNo">158</span> * <code>target/commons-release-plugin</code> directory for the purpose of being uploade by<a name="line.158"></a>
+<span class="sourceLineNo">159</span> * the {@link CommonsDistributionStagingMojo}.<a name="line.159"></a>
+<span class="sourceLineNo">160</span> *<a name="line.160"></a>
+<span class="sourceLineNo">161</span> * @throws MojoExecutionException if some form of an {@link IOException} occurs, we want it<a name="line.161"></a>
+<span class="sourceLineNo">162</span> * properly wrapped so that maven can handle it.<a name="line.162"></a>
+<span class="sourceLineNo">163</span> */<a name="line.163"></a>
+<span class="sourceLineNo">164</span> private void sha1AndMd5SignArtifacts() throws MojoExecutionException {<a name="line.164"></a>
+<span class="sourceLineNo">165</span> for (Artifact artifact : detachedArtifacts) {<a name="line.165"></a>
+<span class="sourceLineNo">166</span> if (!artifact.getFile().getName().contains("asc")) {<a name="line.166"></a>
+<span class="sourceLineNo">167</span> try {<a name="line.167"></a>
+<span class="sourceLineNo">168</span> String md5 = DigestUtils.md5Hex(Files.readAllBytes(artifact.getFile().toPath()));<a name="line.168"></a>
+<span class="sourceLineNo">169</span> getLog().info(artifact.getFile().getName() + " md5: " + md5);<a name="line.169"></a>
+<span class="sourceLineNo">170</span> PrintWriter md5Writer = new PrintWriter(getMd5FilePath(workingDirectory, artifact.getFile()));<a name="line.170"></a>
+<span class="sourceLineNo">171</span> md5Writer.println(md5);<a name="line.171"></a>
+<span class="sourceLineNo">172</span> String sha1 = DigestUtils.sha1Hex(Files.readAllBytes(artifact.getFile().toPath()));<a name="line.172"></a>
+<span class="sourceLineNo">173</span> getLog().info(artifact.getFile().getName() + " sha1: " + sha1);<a name="line.173"></a>
+<span class="sourceLineNo">174</span> PrintWriter sha1Writer = new PrintWriter(getSha1FilePath(workingDirectory, artifact.getFile()));<a name="line.174"></a>
+<span class="sourceLineNo">175</span> sha1Writer.println(sha1);<a name="line.175"></a>
+<span class="sourceLineNo">176</span> md5Writer.close();<a name="line.176"></a>
+<span class="sourceLineNo">177</span> sha1Writer.close();<a name="line.177"></a>
+<span class="sourceLineNo">178</span> } catch (IOException e) {<a name="line.178"></a>
+<span class="sourceLineNo">179</span> throw new MojoExecutionException("Could not sign file: " + artifact.getFile().getName(), e);<a name="line.179"></a>
+<span class="sourceLineNo">180</span> }<a name="line.180"></a>
+<span class="sourceLineNo">181</span> }<a name="line.181"></a>
+<span class="sourceLineNo">182</span> }<a name="line.182"></a>
+<span class="sourceLineNo">183</span> }<a name="line.183"></a>
+<span class="sourceLineNo">184</span><a name="line.184"></a>
+<span class="sourceLineNo">185</span> /**<a name="line.185"></a>
+<span class="sourceLineNo">186</span> * A helper method to create a file path for the <code>md5</code> signature file from a given file.<a name="line.186"></a>
+<span class="sourceLineNo">187</span> *<a name="line.187"></a>
+<span class="sourceLineNo">188</span> * @param workingDirectory is the {@link File} for the directory in which to make the <code>.md5</code> file.<a name="line.188"></a>
+<span class="sourceLineNo">189</span> * @param file the {@link File} whose name we should use to create the <code>.md5</code> file.<a name="line.189"></a>
+<span class="sourceLineNo">190</span> * @return a {@link String} that is the absolute path to the <code>.md5</code> file.<a name="line.190"></a>
+<span class="sourceLineNo">191</span> */<a name="line.191"></a>
+<span class="sourceLineNo">192</span> private String getMd5FilePath(File workingDirectory, File file) {<a name="line.192"></a>
+<span class="sourceLineNo">193</span> StringBuffer buffer = new StringBuffer(workingDirectory.getAbsolutePath());<a name="line.193"></a>
+<span class="sourceLineNo">194</span> buffer.append("/");<a name="line.194"></a>
+<span class="sourceLineNo">195</span> buffer.append(file.getName());<a name="line.195"></a>
+<span class="sourceLineNo">196</span> buffer.append(".md5");<a name="line.196"></a>
+<span class="sourceLineNo">197</span> return buffer.toString();<a name="line.197"></a>
+<span class="sourceLineNo">198</span> }<a name="line.198"></a>
+<span class="sourceLineNo">199</span><a name="line.199"></a>
+<span class="sourceLineNo">200</span> /**<a name="line.200"></a>
+<span class="sourceLineNo">201</span> * A helper method to create a file path for the <code>sha1</code> signature file from a given file.<a name="line.201"></a>
+<span class="sourceLineNo">202</span> *<a name="line.202"></a>
+<span class="sourceLineNo">203</span> * @param workingDirectory is the {@link File} for the directory in which to make the <code>.sha1</code> file.<a name="line.203"></a>
+<span class="sourceLineNo">204</span> * @param file the {@link File} whose name we should use to create the <code>.sha1</code> file.<a name="line.204"></a>
+<span class="sourceLineNo">205</span> * @return a {@link String} that is the absolute path to the <code>.sha1</code> file.<a name="line.205"></a>
+<span class="sourceLineNo">206</span> */<a name="line.206"></a>
+<span class="sourceLineNo">207</span> private String getSha1FilePath(File workingDirectory, File file) {<a name="line.207"></a>
+<span class="sourceLineNo">208</span> StringBuffer buffer = new StringBuffer(workingDirectory.getAbsolutePath());<a name="line.208"></a>
+<span class="sourceLineNo">209</span> buffer.append("/");<a name="line.209"></a>
+<span class="sourceLineNo">210</span> buffer.append(file.getName());<a name="line.210"></a>
+<span class="sourceLineNo">211</span> buffer.append(".sha1");<a name="line.211"></a>
+<span class="sourceLineNo">212</span> return buffer.toString();<a name="line.212"></a>
+<span class="sourceLineNo">213</span> }<a name="line.213"></a>
+<span class="sourceLineNo">214</span>}<a name="line.214"></a>