From 0b5b925b2d2c244841492f59cb8cf532a178d8d6 Mon Sep 17 00:00:00 2001 From: Benjamin Reed Date: Thu, 31 May 2012 16:10:51 -0400 Subject: [PATCH] allow ignoring scope:provided dependencies --- .../tooling/features/GenerateDescriptorMojo.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 2aa483b..73924a6 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 @@ -167,6 +167,15 @@ public class GenerateDescriptorMojo extends AbstractLogEnabled implements Mojo { */ private boolean addBundlesToPrimaryFeature; + /** + * The standard behavior is to add any dependencies other than those in the runtime scope to the feature bundle. + * Setting this flag to "true" disables adding any dependencies (transient or otherwise) that are in + * <scope>provided</scope>. + * + * @parameter default-value="false" + */ + private boolean ignoreScopeProvided; + // ************************************************* // READ-ONLY MAVEN PLUGIN PARAMETERS // ************************************************* @@ -352,7 +361,10 @@ public class GenerateDescriptorMojo extends AbstractLogEnabled implements Mojo { if (bundle == null) { bundle = objectFactory.createBundle(); bundle.setLocation(bundleName); - feature.getBundle().add(bundle); + + if (!"provided".equals(entry.getValue()) || !ignoreScopeProvided) { + feature.getBundle().add(bundle); + } } if ("runtime".equals(entry.getValue())) { bundle.setDependency(true); -- 1.7.9.2