FELIX-5062 : maven-bundle-plugin includes tests dependencies in package analysis. Add test cases from Julian Sedding

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1710724 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index 3e78a5f..f15a34a 100644
--- a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -89,6 +89,7 @@
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.PropertyUtils;
 import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.WriterFactory;
 
 import aQute.bnd.header.Attrs;
 import aQute.bnd.header.OSGiHeader;
@@ -107,7 +108,6 @@
 import aQute.lib.collections.ExtList;
 import aQute.lib.spring.SpringXMLType;
 import aQute.libg.generics.Create;
-import org.codehaus.plexus.util.WriterFactory;
 
 
 /**
@@ -1612,7 +1612,7 @@
         for ( Iterator<Artifact> it = artifacts.iterator(); it.hasNext(); )
         {
             Artifact artifact = it.next();
-            if ( artifact.getArtifactHandler().isAddedToClasspath() )
+            if ( artifact.getArtifactHandler().isAddedToClasspath() && !Artifact.SCOPE_TEST.equals( artifact.getScope() ) )
             {
                 File file = getFile( artifact );
                 if ( file == null )
@@ -2126,7 +2126,7 @@
             else if ( mavenTestSourcePaths.length() > 0 )
             {
                 log.warn( Analyzer.SOURCEPATH + ": overriding " + mavenTestSourcePaths + " with " + sourcePath + " (add "
-                        + MAVEN_TEST_SOURCES + " if you want to include the maven sources)" );
+                        + MAVEN_TEST_SOURCES + " if you want to include the maven test sources)" );
             }
         }
         else if ( mavenSourcePaths.length() > 0 )