From a0d3fb9633f8feadf6675638f0f8df1b0264dc7e Mon Sep 17 00:00:00 2001 From: Sergey Kryuchkov Date: Fri, 9 Sep 2022 11:49:41 +0300 Subject: [PATCH] ENTAXY-374 fix file connection --- .../initializer/connection/ConnectionInitializer.java | 3 ++- .../core/producer/executor/commands/Build.java | 8 ++++++++ .../core/producer/executor/commands/Install.java | 10 ++++++---- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/platform/runtime/core/initializer/connection-initializer/src/main/java/ru/entaxy/esb/platform/runtime/core/initializer/connection/ConnectionInitializer.java b/platform/runtime/core/initializer/connection-initializer/src/main/java/ru/entaxy/esb/platform/runtime/core/initializer/connection/ConnectionInitializer.java index 1a7fc83..ed0408c 100644 --- a/platform/runtime/core/initializer/connection-initializer/src/main/java/ru/entaxy/esb/platform/runtime/core/initializer/connection/ConnectionInitializer.java +++ b/platform/runtime/core/initializer/connection-initializer/src/main/java/ru/entaxy/esb/platform/runtime/core/initializer/connection/ConnectionInitializer.java @@ -204,7 +204,8 @@ public class ConnectionInitializer extends AbstractInitializer { .command("build") .set(EntaxyProducerService.INSTRUCTIONS.ARTIFACT.TIMESTAMP, newTimestamp) .command("install") - .set("update", ""); + .set("update", "") + .set("installLocal", true); String instructions = builder .getInstructionsString(); diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/commands/Build.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/commands/Build.java index 760d439..e18245b 100644 --- a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/commands/Build.java +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/commands/Build.java @@ -21,6 +21,7 @@ package ru.entaxy.platform.core.producer.executor.commands; import java.util.Map; +import org.osgi.framework.Constants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -137,6 +138,13 @@ public class Build extends AbstractCommandExecutor { } } artifact.getProperties().putAll(g.getProperties()); + // TODO get value from manifest + // ArtifactManifest must be improved to provide read access to all attributes + if (!artifact.getProperties().containsKey(Constants.BUNDLE_SYMBOLICNAME)) { + artifact.getProperties().put(Constants.BUNDLE_SYMBOLICNAME + , artifact.getCoordinates().getGroupId() + + "." + artifact.getCoordinates().getArtifactId()); + } artifactList.add(artifact); printOutput("\n\t == " + artifact.getCoordinates().toString() + " ==\n"); printOutput(new String(artifact.asByteArray())); diff --git a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/commands/Install.java b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/commands/Install.java index edfd514..3c20460 100644 --- a/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/commands/Install.java +++ b/platform/runtime/core/object-producing/object-producer-core/src/main/java/ru/entaxy/platform/core/producer/executor/commands/Install.java @@ -90,6 +90,8 @@ public class Install extends AbstractCommandExecutor { Installer installer = null; + String artifactUpdate = update; + printOutput("-> Installing artifact: [" + da.getArtifact().getCoordinates().toString() + "]"); if (installLocal) { LocalInstaller localInstaller = artifactService.installers().local() @@ -110,14 +112,14 @@ public class Install extends AbstractCommandExecutor { BlueprintInstaller blueprintInstaller = installer.typed(BlueprintInstaller.class); if (installOnlyIfMissing) blueprintInstaller.installOnlyIfMissing(); - if (update != null) { - if (!CommonUtils.isValid(update)) { - update = da + if (artifactUpdate != null) { + if (!CommonUtils.isValid(artifactUpdate)) { + artifactUpdate = da .getArtifact().getProperties() .getOrDefault(Constants.BUNDLE_SYMBOLICNAME, "") .toString(); } - blueprintInstaller.update(update); + blueprintInstaller.update(artifactUpdate); } result = blueprintInstaller.start().install(); } else {