karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject karaf git commit: [KARAF-3709] The assembly builder should generate mvn urls for startup bundles
Date Tue, 28 Apr 2015 09:58:08 GMT
Repository: karaf
Updated Branches:
  refs/heads/master 30752c9d8 -> 04f96c259


[KARAF-3709] The assembly builder should generate mvn urls for startup bundles


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/04f96c25
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/04f96c25
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/04f96c25

Branch: refs/heads/master
Commit: 04f96c2598fea31fe67e93b20cf7b6fafe886316
Parents: 30752c9
Author: Guillaume Nodet <gnodet@gmail.com>
Authored: Tue Apr 28 11:57:56 2015 +0200
Committer: Guillaume Nodet <gnodet@gmail.com>
Committed: Tue Apr 28 11:58:04 2015 +0200

----------------------------------------------------------------------
 .../karaf/profile/assembly/AssemblyDeployCallback.java      | 5 ++++-
 .../java/org/apache/karaf/profile/assembly/Builder.java     | 9 +++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/04f96c25/profile/src/main/java/org/apache/karaf/profile/assembly/AssemblyDeployCallback.java
----------------------------------------------------------------------
diff --git a/profile/src/main/java/org/apache/karaf/profile/assembly/AssemblyDeployCallback.java
b/profile/src/main/java/org/apache/karaf/profile/assembly/AssemblyDeployCallback.java
index 34a23f1..4ef295c 100644
--- a/profile/src/main/java/org/apache/karaf/profile/assembly/AssemblyDeployCallback.java
+++ b/profile/src/main/java/org/apache/karaf/profile/assembly/AssemblyDeployCallback.java
@@ -195,11 +195,14 @@ public class AssemblyDeployCallback implements Deployer.DeployCallback
{
         // Install
         LOGGER.info("Installing bundle " + uri);
         try {
+            String regUri;
             String path;
             if (uri.startsWith("mvn:")) {
+                regUri = uri;
                 path = Parser.pathFromMaven(uri);
             } else {
                 path = "generated/" + uri.replaceAll("[^0-9a-zA-Z.\\-_]+", "_");
+                regUri = "file:" + path;
             }
             final Path bundleSystemFile = systemDirectory.resolve(path);
             Files.createDirectories(bundleSystemFile.getParent());
@@ -216,7 +219,7 @@ public class AssemblyDeployCallback implements Deployer.DeployCallback
{
             MapUtils.addToMapSet(dstate.bundlesPerRegion, region, bundle.getBundleId());
             dstate.bundles.put(bundle.getBundleId(), bundle);
 
-            bundles.put(path, bundle);
+            bundles.put(regUri, bundle);
             return bundle;
         } catch (IOException e) {
             throw new BundleException("Unable to install bundle", e);

http://git-wip-us.apache.org/repos/asf/karaf/blob/04f96c25/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java
----------------------------------------------------------------------
diff --git a/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java b/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java
index 21b0a44..ea5c6d7 100644
--- a/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java
+++ b/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java
@@ -935,8 +935,13 @@ public class Builder {
         for (Map.Entry<Integer, Set<String>> entry : invertedStartupBundles.entrySet())
{
             String startLevel = Integer.toString(entry.getKey());
             for (String location : new TreeSet<>(entry.getValue())) {
-                if (location.startsWith("file:") && useReferenceUrls) {
-                    location = "reference:" + location;
+                if (useReferenceUrls) {
+                    if (location.startsWith("mvn:")) {
+                        location = "file:" + Parser.pathFromMaven(location);
+                    }
+                    if (location.startsWith("file:")) {
+                        location = "reference:" + location;
+                    }
                 }
                 if (location.startsWith("file:") && karafVersion == KarafVersion.v24)
{
                     location = location.substring("file:".length());


Mime
View raw message