Include conditional bundles on karaf-maven-plugin generated kar (offline deploy support)
@@ -28,6 +28,7 @@ import java.util.regex.Pattern;
import org.apache.karaf.deployer.kar.KarArtifactInstaller;
import org.apache.karaf.features.BundleInfo;
+import org.apache.karaf.features.Conditional;
import org.apache.karaf.features.ConfigFileInfo;
import org.apache.karaf.features.internal.model.Feature;
import org.apache.karaf.features.internal.model.Features;
@@ -205,10 +206,17 @@ public class KarMojo extends MojoSupport {
Features features = JaxbUtil.unmarshal(featuresFile.toURI().toASCIIString(), false);
for (Feature feature : features.getFeature()) {
for (BundleInfo bundle : feature.getBundles()) {
- if (ignoreDependencyFlag || (!ignoreDependencyFlag && !bundle.isDependency())) {
+ if (ignoreDependencyFlag || !bundle.isDependency()) {
resources.add(resourceToArtifact(bundle.getLocation(), false));
}
}
+ for (Conditional conditional : feature.getConditional()) {
+ for (BundleInfo bundle : conditional.getBundles()) {
+ if (ignoreDependencyFlag || !bundle.isDependency()) {
+ resources.add(resourceToArtifact(bundle.getLocation(), false));
+ }
+ }
+ }
for (ConfigFileInfo configFile : feature.getConfigurationFiles()) {
resources.add(resourceToArtifact(configFile.getLocation(), false));
}
