Merge pull request 'ENTAXY-374 fix file connection' (#11) from ENTAXY-374 into master

Reviewed-on: #11
This commit is contained in:
Сергей Крючков 2022-09-09 10:33:08 +00:00
commit 607f92e595
3 changed files with 16 additions and 5 deletions

View File

@ -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();

View File

@ -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()));

View File

@ -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 {