X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=org.argeo.osgi.boot%2Fsrc%2Forg%2Fargeo%2Fosgi%2Fboot%2FOsgiBoot.java;h=effdcf3baf3bc7daf3e46d0692855a667e93001a;hb=40af4cc6795ab669ec9432d1444f0779f9594952;hp=bdf7134b85441df762d5ca3120e4e51b43e6f768;hpb=5dc0e30ff215c1604b1b0e7bf8c8699f6cd1257f;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java index bdf7134b8..effdcf3ba 100644 --- a/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java +++ b/org.argeo.osgi.boot/src/org/argeo/osgi/boot/OsgiBoot.java @@ -19,6 +19,7 @@ import static org.argeo.osgi.boot.OsgiBootUtils.debug; import static org.argeo.osgi.boot.OsgiBootUtils.warn; import java.io.File; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -95,8 +96,8 @@ public class OsgiBoot implements OsgiBootConstants { /** Constructor */ public OsgiBoot(BundleContext bundleContext) { this.bundleContext = bundleContext; - localCache = getProperty(PROP_ARGEO_OSGI_LOCAL_CACHE, - "file://" + System.getProperty("user.home") + "/.m2/repository/"); + String homeUri = Paths.get(System.getProperty("user.home")).toUri().toString(); + localCache = getProperty(PROP_ARGEO_OSGI_LOCAL_CACHE, homeUri + ".m2/repository/"); } /* @@ -215,16 +216,21 @@ public class OsgiBoot implements OsgiBootConstants { } } } catch (BundleException e) { + final String ALREADY_INSTALLED = "is already installed"; String message = e.getMessage(); if ((message.contains("Bundle \"" + SYMBOLIC_NAME_OSGI_BOOT + "\"") || message.contains("Bundle \"" + SYMBOLIC_NAME_EQUINOX + "\"")) - && message.contains("is already installed")) { + && message.contains(ALREADY_INSTALLED)) { // silent, in order to avoid warnings: we know that both // have already been installed... } else { - OsgiBootUtils.warn("Could not install bundle from " + url + ": " + message); + if (message.contains(ALREADY_INSTALLED)) { + if (OsgiBootUtils.isDebug()) + OsgiBootUtils.warn("Duplicate install from " + url + ": " + message); + } else + OsgiBootUtils.warn("Could not install bundle from " + url + ": " + message); } - if (OsgiBootUtils.debug && !message.contains("is already installed")) + if (OsgiBootUtils.debug && !message.contains(ALREADY_INSTALLED)) e.printStackTrace(); } }