This is an automated email from the ASF dual-hosted git repository. ffang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/karaf.git
The following commit(s) were added to refs/heads/master by this push: new b531a0d [KARAF-6157]ensure karaf-maven-plugin can honor start-level for bootBundles b531a0d is described below commit b531a0dac6b85e7f559979db5d5b975d319462b4 Author: Freeman Fang <freeman.f...@gmail.com> AuthorDate: Thu Feb 14 16:46:45 2019 +0800 [KARAF-6157]ensure karaf-maven-plugin can honor start-level for bootBundles --- .../java/org/apache/karaf/profile/assembly/Builder.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 00bbc0a..a48da2d 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 @@ -129,6 +129,7 @@ public class Builder { private static final String LIBRARY_CLAUSE_TYPE = "type"; private static final String LIBRARY_CLAUSE_EXPORT = "export"; private static final String LIBRARY_CLAUSE_DELEGATE = "delegate"; + private static final String START_LEVEL = "start-level"; public static final String ORG_OPS4J_PAX_URL_MVN_PID = "org.ops4j.pax.url.mvn"; @@ -1720,7 +1721,23 @@ public class Builder { // Add bundles for (String location : bootEffective.getBundles()) { location = location.replace("profile:", "file:etc/"); + int intLevel = -100; + if (location.contains(START_LEVEL)) { + //extract start-level for this bundle + String level = location.substring(location.indexOf(START_LEVEL)); + level = level.substring(START_LEVEL.length() + 1); + if (level.startsWith("\"")) { + level = level.substring(1, level.length() - 1); + } + intLevel = Integer.valueOf(level); + LOGGER.debug("bundle start-level: " + level); + location = location.substring(0, location.indexOf(START_LEVEL) - 1); + LOGGER.debug("new bundle location after strip start-level: " + location); + } Bundle bun = new Bundle(); + if (intLevel > 0) { + bun.setStartLevel(intLevel); + } bun.setLocation(location); generated.getBundle().add(bun); }