karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject karaf git commit: [KARAF-4999] Ignore bundle maching configfile in a features to avoid incorrect features XML
Date Wed, 01 Mar 2017 15:02:03 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-4.0.x 2fc4a07d9 -> b970f0f9f


[KARAF-4999] Ignore bundle maching configfile in a features to avoid incorrect features XML


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

Branch: refs/heads/karaf-4.0.x
Commit: b970f0f9f933301e9df5b64386c3ad57a5298759
Parents: 2fc4a07
Author: Stephen Kitt <skitt@redhat.com>
Authored: Fri Feb 24 18:25:58 2017 +0100
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Wed Mar 1 16:01:55 2017 +0100

----------------------------------------------------------------------
 .../karaf/tooling/features/GenerateDescriptorMojo.java      | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/b970f0f9/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
----------------------------------------------------------------------
diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
index d045975..6000daf 100644
--- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
+++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/GenerateDescriptorMojo.java
@@ -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;
@@ -452,6 +453,7 @@ public class GenerateDescriptorMojo extends MojoSupport {
 
         // Second pass to look for bundles
         if (addBundlesToPrimaryFeature) {
+            localDependency:
             for (final LocalDependency entry : localDependencies) {
                 Object artifact = entry.getArtifact();
 
@@ -464,6 +466,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;


Mime
View raw message