karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject git commit: [KARAF-1514] Add ignoreScopeProvided configuration on the feature-generate-descriptor goal
Date Fri, 26 Sep 2014 07:47:28 GMT
Repository: karaf
Updated Branches:
  refs/heads/master db62e5d83 -> 39a207507


[KARAF-1514] Add ignoreScopeProvided configuration on the feature-generate-descriptor goal


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

Branch: refs/heads/master
Commit: 39a207507b43e0ebba505457aa6e806aa0f398bb
Parents: db62e5d
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Fri Sep 26 09:46:05 2014 +0200
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Fri Sep 26 09:46:05 2014 +0200

----------------------------------------------------------------------
 .../tooling/features/GenerateDescriptorMojo.java | 19 +++++++++++++++----
 .../karaf/tooling/features/InstallKarsMojo.java  |  4 ++--
 2 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/39a20750/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 3cdae4a..cf05eb6 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
@@ -146,9 +146,9 @@ public class GenerateDescriptorMojo extends AbstractLogEnabled implements
Mojo {
 
     /**
      * Installation mode. If present, generate "feature.install" attribute:
-     *
+     * <p/>
      * <a href="http://karaf.apache.org/xmlns/features/v1.1.0">Installation mode</a>
-     *
+     * <p/>
      * Can be either manual or auto. Specifies whether the feature should be automatically
installed when
      * dropped inside the deploy folder. Note: this attribute doesn't affect feature descriptors
that are installed
      * from the feature:install command or as part of the etc/org.apache.karaf.features.cfg
file.
@@ -175,6 +175,15 @@ public class GenerateDescriptorMojo extends AbstractLogEnabled implements
Mojo {
      */
     private boolean addBundlesToPrimaryFeature;
 
+    /**
+     * The standard behavior is to add any dependencies other than those in the <code>runtime</code>
scope to the feature bundle.
+     * Setting this flag to "true" disables adding any dependencies (transient or otherwise)
that are in
+     * <code>&lt;scope&gt;provided&lt;/scope&gt;</code>.
+     *
+     * @parameter default-value="false"
+     */
+    private boolean ignoreScopeProvided;
+
     // *************************************************
     // READ-ONLY MAVEN PLUGIN PARAMETERS
     // *************************************************
@@ -347,7 +356,9 @@ 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);
@@ -654,7 +665,7 @@ public class GenerateDescriptorMojo extends AbstractLogEnabled implements
Mojo {
             }
             targetFile.getParentFile().mkdirs();
             @SuppressWarnings("rawtypes")
-			List filters = mavenFileFilter.getDefaultFilterWrappers(project, null, true, session,
null);
+            List filters = mavenFileFilter.getDefaultFilterWrappers(project, null, true,
session, null);
             mavenFileFilter.copyFile(sourceFile, targetFile, true, filters, encoding, true);
         } catch (MavenFilteringException e) {
             throw new MojoExecutionException(e.getMessage(), e);

http://git-wip-us.apache.org/repos/asf/karaf/blob/39a20750/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java
----------------------------------------------------------------------
diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java
b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java
index 6e78565..dcc1a56 100644
--- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java
+++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/InstallKarsMojo.java
@@ -111,9 +111,9 @@ public class InstallKarsMojo extends MojoSupport {
     /**
      * Ignore the dependency attribute (dependency="[true|false]") on bundle
      *
-     * @parameter
+     * @parameter default-value="true"
      */
-    protected boolean ignoreDependencyFlag = true;
+    protected boolean ignoreDependencyFlag;
 
     private URI system;
     private Properties startupProperties = new Properties();


Mime
View raw message