diff --git a/assemblies/apache-karaf/src/main/filtered-resources/minimal/org.apache.karaf.features.cfg b/assemblies/apache-karaf/src/main/filtered-resources/minimal/org.apache.karaf.features.cfg index ed41ffd..1357ce0 100644 --- a/assemblies/apache-karaf/src/main/filtered-resources/minimal/org.apache.karaf.features.cfg +++ b/assemblies/apache-karaf/src/main/filtered-resources/minimal/org.apache.karaf.features.cfg @@ -18,6 +18,12 @@ ################################################################################ # +# Defines if the startlvl should be respected during feature startup. The default value is for 3.x is true. +# The default behavior for 2.x is false (!) for this property +# +#respectStartLvlDuringFeatureStartup=false + +# # Comma separated list of features repositories to register by default # # diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java b/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java index 049015a..3c9daa7 100644 --- a/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java +++ b/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java @@ -31,6 +31,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.Comparator; import java.util.Dictionary; import java.util.EnumSet; import java.util.Enumeration; @@ -99,6 +100,7 @@ public class FeaturesServiceImpl implements FeaturesService, FrameworkListener { private ConfigurationAdmin configAdmin; private PackageAdmin packageAdmin; private StartLevel startLevel; + private boolean respectStartLvlDuringFeatureStartup; private long resolverTimeout = 5000; private Set uris; private Map repositories = new HashMap(); @@ -143,6 +145,10 @@ public class FeaturesServiceImpl implements FeaturesService, FrameworkListener { return startLevel; } + public void setRespectStartLvlDuringFeatureStartup(boolean respectStartLvlDuringFeatureStartup) { + this.respectStartLvlDuringFeatureStartup = respectStartLvlDuringFeatureStartup; + } + public void setStartLevel(StartLevel startLevel) { this.startLevel = startLevel; } @@ -388,8 +394,8 @@ public class FeaturesServiceImpl implements FeaturesService, FrameworkListener { } public void installFeatures(Set features, EnumSet {code} +{warning} +Before Karaf 3.0 the start-level was NOT considered during the feature startup, but only the order in which bundles are defined in your feature.xml. Starting with 3.0 the start-level is no considered correctly. If you need to use the old behavior you can uncomment and change the respectStartLvlDuringFeatureStartup variable in org.apache.karaf.features.xml to false. But please be aware that it will be removed in 4.0 and should therefore be used only temporarily. +{warning} + h4. Bundle 'dependency' A bundle can be flagged as being a dependency. Such information can be used by resolvers to compute the full list of bundles to be installed.