Ignore bundle maching configfile in a features to avoid incorrect features XML
@@ -47,6 +47,7 @@ import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLStreamException;
import org.apache.karaf.features.internal.model.Bundle;
+import org.apache.karaf.features.internal.model.ConfigFile;
import org.apache.karaf.features.internal.model.Dependency;
import org.apache.karaf.features.internal.model.Feature;
import org.apache.karaf.features.internal.model.Features;
@@ -472,6 +473,7 @@ public class GenerateDescriptorMojo extends MojoSupport {
// Second pass to look for bundles
if (addBundlesToPrimaryFeature) {
+ localDependency:
for (final LocalDependency entry : localDependencies) {
Object artifact = entry.getArtifact();
@@ -484,6 +486,13 @@ public class GenerateDescriptorMojo extends MojoSupport {
File bundleFile = this.dependencyHelper.resolve(artifact, getLog());
Manifest manifest = getManifest(bundleFile);
+ for (ConfigFile cf : feature.getConfigfile()) {
+ if (bundleName.equals(cf.getLocation().replace('\n', ' ').trim())) {
+ // The bundle matches a configfile, ignore it
+ continue localDependency;
+ }
+ }
+
if (manifest == null || !ManifestUtils.isBundle(getManifest(bundleFile))) {
bundleName = "wrap:" + bundleName;
needWrap = true;
