FELIX-449: add 'excludeDependencies' option (disabled by default) to exclude all dependencies from the classpath passed to BND

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@610446 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index 9f5213c..8fb23da 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -27,6 +27,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -85,6 +86,13 @@
     protected boolean unpackBundle;
 
     /**
+     * When true, exclude project dependencies from the classpath passed to BND
+     *
+     * @parameter expression="${excludeDependencies}"
+     */
+    protected boolean excludeDependencies;
+
+    /**
      * @component
      */
     private ArchiverManager archiverManager;
@@ -554,7 +562,16 @@
             list.add(new Jar(".", this.getOutputDirectory()));
         }
 
-        Set artifacts = project.getArtifacts();
+        final Set artifacts;
+        if (excludeDependencies)
+        {
+            artifacts = Collections.EMPTY_SET;
+        }
+        else
+        {
+            artifacts = project.getArtifacts();
+        }
+
         for (Iterator it = artifacts.iterator(); it.hasNext();)
         {
             Artifact artifact = (Artifact) it.next();