Adding site zipper, not finished
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/e0b91288 Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/e0b91288 Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/e0b91288 Branch: refs/heads/master Commit: e0b91288f4202f5b223b6f9251b4abe9f7889497 Parents: 9923a5a Author: Rob Tompkins <[email protected]> Authored: Mon Jan 1 13:27:46 2018 -0500 Committer: Rob Tompkins <[email protected]> Committed: Mon Jan 1 13:27:46 2018 -0500 ---------------------------------------------------------------------- pom.xml | 5 +++++ .../mojos/CommonsDistributionDetatchmentMojo.java | 17 ++--------------- 2 files changed, 7 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/e0b91288/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 664c9f8..1d8f463 100644 --- a/pom.xml +++ b/pom.xml @@ -112,6 +112,11 @@ <version>1.10</version> </dependency> <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-compress</artifactId> + <version>1.15</version> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/e0b91288/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java index 4df4579..a0fe1b0 100644 --- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java +++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java @@ -18,6 +18,7 @@ package org.apache.commons.release.plugin.mojos; import edu.emory.mathcs.backport.java.util.Collections; import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.release.plugin.SharedFunctions; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; @@ -90,26 +91,12 @@ public class CommonsDistributionDetatchmentMojo extends AbstractMojo { for(AttachedArtifact artifactToRemove : detatchedArtifacts) { project.getAttachedArtifacts().remove(artifactToRemove); } - initWorkingDirectory(); + SharedFunctions.initWorkingDirectory(getLog(), workingDirectory); copyRemovedArtifactsToWorkingDirectory(); getLog().info(""); sha1AndMd5SignArtifacts(); } - private void initWorkingDirectory() throws MojoExecutionException { - if (workingDirectory.exists()) { - try { - FileUtils.deleteDirectory(workingDirectory); - } catch (IOException e) { - getLog().error(e.getMessage()); - throw new MojoExecutionException("Unable to remove working directory: " + e.getMessage(), e); - } - } - if (!workingDirectory.exists()) { - workingDirectory.mkdirs(); - } - } - private void copyRemovedArtifactsToWorkingDirectory() throws MojoExecutionException { StringBuffer copiedArtifactAbsolutePath; getLog().info("Copying detatched artifacts to working directory.");
