Index: tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/DependencyHelper.java
===================================================================
--- tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/DependencyHelper.java	(revision 1540281)
+++ tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/features/DependencyHelper.java	(working copy)
@@ -18,6 +18,7 @@
  */
 package org.apache.karaf.tooling.features;
 
+import java.util.Arrays;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
@@ -32,10 +33,8 @@
 import org.sonatype.aether.artifact.Artifact;
 import org.sonatype.aether.collection.CollectRequest;
 import org.sonatype.aether.collection.CollectResult;
-import org.sonatype.aether.collection.DependencyCollectionContext;
 import org.sonatype.aether.collection.DependencyCollectionException;
 import org.sonatype.aether.collection.DependencyGraphTransformer;
-import org.sonatype.aether.collection.DependencySelector;
 import org.sonatype.aether.graph.Dependency;
 import org.sonatype.aether.graph.DependencyNode;
 import org.sonatype.aether.repository.RemoteRepository;
@@ -43,6 +42,7 @@
 import org.sonatype.aether.util.graph.selector.AndDependencySelector;
 import org.sonatype.aether.util.graph.selector.ExclusionDependencySelector;
 import org.sonatype.aether.util.graph.selector.OptionalDependencySelector;
+import org.sonatype.aether.util.graph.selector.ScopeDependencySelector;
 import org.sonatype.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
 import org.sonatype.aether.util.graph.transformer.ConflictMarker;
 import org.sonatype.aether.util.graph.transformer.JavaDependencyContextRefiner;
@@ -109,13 +109,16 @@
         treeListing = scanner.getLog();
     }
 
-    private DependencyNode getDependencyTree(Artifact artifact) throws MojoExecutionException {
+    public DependencyNode getDependencyTree(Artifact artifact) throws MojoExecutionException {
         try {
             CollectRequest collectRequest = new CollectRequest(new Dependency(artifact, "compile"), null, projectRepos);
             DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(repoSession);
-            session.setDependencySelector(new AndDependencySelector(new OptionalDependencySelector(),
-                    new ScopeDependencySelector1(),
-                    new ExclusionDependencySelector()));
+            ScopeDependencySelector selector = new ScopeDependencySelector(
+            		Arrays.asList("compile", "runtime"), 
+    				Arrays.asList("provided", "system", "test"));
+            session.setDependencySelector(new AndDependencySelector(new OptionalDependencySelector(), 
+            		selector,
+            		new ExclusionDependencySelector()));
             DependencyGraphTransformer transformer = new ChainedDependencyGraphTransformer(new ConflictMarker(),
                     new JavaEffectiveScopeCalculator(),
                     new JavaDependencyContextRefiner());
@@ -127,53 +130,11 @@
         }
     }
 
-    //aether's ScopeDependencySelector appears to always exclude the configured scopes (test and provided) and there is no way to configure it to
-    //accept the top level provided scope dependencies.  We need this 3 layer cake since aether never actually uses the top level selector you give it,
-    //it always starts by getting the child to apply to the project's dependencies.
-    private static class ScopeDependencySelector1 implements DependencySelector {
-
-        private DependencySelector child = new ScopeDependencySelector2();
-
-        public boolean selectDependency(Dependency dependency) {
-            throw new IllegalStateException("this does not appear to be called");
-        }
-
-        public DependencySelector deriveChildSelector(DependencyCollectionContext context) {
-            return child;
-        }
-    }
-
-    private static class ScopeDependencySelector2 implements DependencySelector {
-
-        private DependencySelector child = new ScopeDependencySelector3();
-
-        public boolean selectDependency(Dependency dependency) {
-            String scope = dependency.getScope();
-            return !"test".equals(scope) && !"runtime".equals(scope);
-        }
-
-        public DependencySelector deriveChildSelector(DependencyCollectionContext context) {
-            return child;
-        }
-    }
-
-    private static class ScopeDependencySelector3 implements DependencySelector {
-
-        public boolean selectDependency(Dependency dependency) {
-            String scope = dependency.getScope();
-            return !"test".equals(scope) && !"provided".equals(scope) && !"runtime".equals(scope);
-        }
-
-        public DependencySelector deriveChildSelector(DependencyCollectionContext context) {
-            return this;
-        }
-    }
-
     private static class Scanner {
 
         private static enum Accept {
             ACCEPT(true, true),
-            PROVIDED(true, false),
+            PROVIDED(false, false),
             STOP(false, false);
 
             private final boolean more;
@@ -248,7 +209,7 @@
         }
 
         private Accept accept(DependencyNode dependency, Accept previous) {
-            String scope = dependency.getPremanagedScope();
+            String scope = dependency.getDependency().getScope();
             if (scope == null || "runtime".equalsIgnoreCase(scope) || "compile".equalsIgnoreCase(scope)) {
                 return previous;
             }
Index: tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/features/FeatureLoadTest.java
===================================================================
--- tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/features/FeatureLoadTest.java	(revision 0)
+++ tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/features/FeatureLoadTest.java	(working copy)
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.karaf.tooling.features;
+
+import static org.junit.Assert.*;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.util.List;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.karaf.features.FeaturesNamespaces;
+import org.apache.karaf.features.internal.model.Features;
+import org.apache.karaf.features.internal.model.Feature;
+import org.apache.karaf.features.internal.model.JaxbUtil;
+import org.junit.Test;
+import org.xml.sax.SAXException;
+
+public class FeatureLoadTest {
+
+    @Test
+    public void testReadXml100() throws JAXBException, SAXException, ParserConfigurationException, XMLStreamException {
+        InputStream in = getClass().getClassLoader().getResourceAsStream("input-features-1.0.0.xml");
+        Features featuresRoot = JaxbUtil.unmarshal(in, false);
+        assertEquals(featuresRoot.getRepository().size(), 1);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        JaxbUtil.marshal(featuresRoot, baos);
+        String text = new String(baos.toByteArray());
+        assertTrue(text.contains("repository"));
+        assertTrue(text.contains(FeaturesNamespaces.URI_CURRENT));
+    }
+
+    @Test
+    public void testReadXml110() throws Exception {
+        InputStream in = getClass().getClassLoader().getResourceAsStream("input-features-1.1.0.xml");
+        Features featuresRoot = JaxbUtil.unmarshal(in, false);
+        List<Feature> featuresList = featuresRoot.getFeature();
+        assertEquals(featuresList.size(), 1);
+        Feature feature = featuresList.get(0);
+        assertEquals(feature.getInstall(), "auto");
+    }
+
+}

Property changes on: tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/features/FeatureLoadTest.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Revision
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateDescriptorMojoTest.java
===================================================================
--- tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateDescriptorMojoTest.java	(revision 1540281)
+++ tooling/karaf-maven-plugin/src/test/java/org/apache/karaf/tooling/features/GenerateDescriptorMojoTest.java	(working copy)
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.karaf.tooling.features;
-
-import static org.junit.Assert.*;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.util.List;
-
-import javax.xml.bind.JAXBException;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.karaf.features.FeaturesNamespaces;
-import org.apache.karaf.features.internal.model.Features;
-import org.apache.karaf.features.internal.model.Feature;
-import org.apache.karaf.features.internal.model.JaxbUtil;
-import org.junit.Test;
-import org.xml.sax.SAXException;
-
-public class GenerateDescriptorMojoTest {
-
-    @Test
-    public void testReadXml100() throws JAXBException, SAXException, ParserConfigurationException, XMLStreamException {
-
-        InputStream in = getClass().getClassLoader().getResourceAsStream("input-features-1.0.0.xml");
-
-        Features featuresRoot = JaxbUtil.unmarshal(in, false);
-
-        assertEquals(featuresRoot.getRepository().size(), 1);
-
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
-        JaxbUtil.marshal(featuresRoot, baos);
-
-        String text = new String(baos.toByteArray());
-
-        assertTrue(text.contains("repository"));
-
-        assertTrue(text.contains(FeaturesNamespaces.URI_CURRENT));
-    }
-
-    @Test
-    public void testReadXml1() throws Exception {
-
-        InputStream in = getClass().getClassLoader().getResourceAsStream("input-features-1.1.0.xml");
-
-        Features featuresRoot = JaxbUtil.unmarshal(in, false);
-
-        List<Feature> featuresList = featuresRoot.getFeature();
-
-        assertEquals(featuresList.size(), 1);
-
-        Feature feature = featuresList.get(0);
-
-        assertEquals(feature.getInstall(), "auto");
-    }
-
-}
