aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/tools/artifact-copy-plugin/src
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/tools/artifact-copy-plugin/src')
-rw-r--r--openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/ArtifactHelper.java5
-rw-r--r--openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/InitializationHelperMojo.java7
2 files changed, 10 insertions, 2 deletions
diff --git a/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/ArtifactHelper.java b/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/ArtifactHelper.java
index f51a8aae60..f5bbbd605a 100644
--- a/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/ArtifactHelper.java
+++ b/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/ArtifactHelper.java
@@ -49,6 +49,7 @@ public class ArtifactHelper {
private static File unicornMetaLocation = null;
private File tempLocation = Paths.get(System.getProperties().getProperty("java.io.tmpdir")).toFile();
private static int snapshotBuildNumber = 0;
+ private static final String HYPHEN = "-";
void init(String terminalModuleCoordinate) {
setUnicornMetaLocation(getUnicornRootFile(unicornRoot.substring(0, unicornRoot.indexOf('/')), project));
@@ -141,11 +142,13 @@ public class ArtifactHelper {
try (InputStream is = new FileInputStream(file); ObjectInputStream ois = new ObjectInputStream(is)) {
dataStore = HashMap.class.cast(ois.readObject());
dataStore.put("shutdownTime", (System.currentTimeMillis() / 1000) * 1000 + snapshotBuildNumber);
+ dataStore.put("version", project.getVersion());
}
try (OutputStream os = new FileOutputStream(file); ObjectOutputStream oos = new ObjectOutputStream(os)) {
oos.writeObject(dataStore);
}
- Files.copy(file.toPath(), Paths.get(tempLocation.getAbsolutePath(), file.getName()),
+ Files.copy(file.toPath(),
+ Paths.get(tempLocation.getAbsolutePath(), file.getName() + HYPHEN + project.getVersion()),
StandardCopyOption.REPLACE_EXISTING);
}
}
diff --git a/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/InitializationHelperMojo.java b/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/InitializationHelperMojo.java
index 6fa9b0e365..9585057524 100644
--- a/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/InitializationHelperMojo.java
+++ b/openecomp-be/tools/artifact-copy-plugin/src/main/java/org/openecomp/sdc/onboarding/util/InitializationHelperMojo.java
@@ -67,6 +67,11 @@ public class InitializationHelperMojo extends AbstractMojo {
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (System.getProperties().containsKey(UNICORN_INITIALIZED)) {
+ try {
+ artifactHelper.shutDown(project);
+ } catch (IOException | ClassNotFoundException e) {
+ throw new MojoExecutionException("Unexpected Error Occured during shutdown activities", e);
+ }
return;
}
artifactHelper.init(groupId + ":" + artifactId);
@@ -105,7 +110,7 @@ public class InitializationHelperMojo extends AbstractMojo {
byte[] data = fetchContents(repo.getUrl(), artifactId, timestamp + "-" + buildNumber);
artifactHelper.store(artifactId, data);
getLog().info(artifactId + " Version to be copied is " + timestamp + "-" + buildNumber);
- artifactHelper.setSnapshotBuildNumber(Integer.parseInt(buildNumber));
+ ArtifactHelper.setSnapshotBuildNumber(Integer.parseInt(buildNumber));
return timestamp + "-" + buildNumber;
}
} catch (IOException e) {