- localCache = getProperty(PROP_ARGEO_OSGI_LOCAL_CACHE,
- "file://" + System.getProperty("user.home") + "/.m2/repository/");
+ Path homePath = Paths.get(System.getProperty("user.home")).toAbsolutePath();
+ String homeUri = homePath.toUri().toString();
+ localCache = getProperty(PROP_ARGEO_OSGI_LOCAL_CACHE, homeUri + ".m2/repository/");
+
+ provisioningManager = new ProvisioningManager(bundleContext);
+ String sources = getProperty(PROP_ARGEO_OSGI_SOURCES);
+ if (sources == null) {
+ provisioningManager.registerDefaultSource();
+ } else {
+ for (String source : sources.split(",")) {
+ if (source.trim().equals(A2Source.DEFAULT_A2_URI)) {
+ if (Files.exists(homePath))
+ provisioningManager.registerSource(
+ A2Source.SCHEME_A2 + "://" + homePath.toString() + "/.local/share/osgi");
+ provisioningManager.registerSource(A2Source.SCHEME_A2 + ":///usr/local/share/osgi");
+ provisioningManager.registerSource(A2Source.SCHEME_A2 + ":///usr/share/osgi");
+ } else {
+ provisioningManager.registerSource(source);
+ }
+ }
+ }
+ }
+
+ ProvisioningManager getProvisioningManager() {
+ return provisioningManager;