summaryrefslogtreecommitdiffstats
path: root/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/CalibrateArtifactPlugin.java
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/CalibrateArtifactPlugin.java')
-rw-r--r--openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/CalibrateArtifactPlugin.java36
1 files changed, 6 insertions, 30 deletions
diff --git a/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/CalibrateArtifactPlugin.java b/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/CalibrateArtifactPlugin.java
index 4838608835..96f29d0054 100644
--- a/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/CalibrateArtifactPlugin.java
+++ b/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/CalibrateArtifactPlugin.java
@@ -2,10 +2,6 @@ package org.openecomp.sdc.onboarding.util;
import java.io.File;
import java.io.IOException;
-import java.io.UncheckedIOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
@@ -37,46 +33,26 @@ public class CalibrateArtifactPlugin extends AbstractMojo {
@Parameter
private String version;
@Parameter
- private String targetLocation;
- @Parameter
- private String name;
- @Parameter
private String excludePackaging;
@Parameter
private ArtifactHelper artifactHelper;
+ @Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (project.getPackaging().equals(excludePackaging)) {
return;
}
if (project.getProperties().containsKey(ARTIFACT_COPY_PATH)
&& project.getProperties().getProperty(ARTIFACT_COPY_PATH) != null) {
- File f = null;
- String artifactPath = project.getProperties().getProperty(ARTIFACT_COPY_PATH)
- .startsWith(session.getLocalRepository().getBasedir()) ?
- project.getProperties().getProperty(ARTIFACT_COPY_PATH) :
- project.getProperties().getProperty(ARTIFACT_COPY_PATH)
- .replace(groupId, groupId.replace('.', '/'));
- if (artifactPath.startsWith(session.getLocalRepository().getBasedir())) {
- f = new File(artifactPath);
- } else {
- f = new File(session.getLocalRepository().getBasedir(), artifactPath);
- }
+ File f = new File(project.getProperties().getProperty(ARTIFACT_COPY_PATH));
if (f.exists()) {
project.getArtifact().setFile(f);
}
}
- File file = new File(project.getBuild().getDirectory(), project.getBuild().getFinalName() + ".unicorn");
- if (file.exists()) {
- try {
- Files.copy(file.toPath(), Paths.get(
- session.getLocalRepository().getBasedir() + File.separator + project.getGroupId().replace(".",
- File.separator) + File.separator + project.getArtifactId() + File.separator
- + project.getVersion(), project.getBuild().getFinalName() + ".unicorn"),
- StandardCopyOption.REPLACE_EXISTING);
- } catch (IOException e) {
- throw new UncheckedIOException(e);
- }
+ try {
+ artifactHelper.shutDown(project);
+ } catch (IOException | ClassNotFoundException e) {
+ throw new MojoExecutionException("Unexpected Error Occured during shutdown activities", e);
}
}
}