gnodet commented on code in PR #1398:
URL: https://github.com/apache/maven/pull/1398#discussion_r1478270635


##########
maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.java:
##########
@@ -240,8 +240,11 @@ private Set<Artifact> getDependencies(
         scopesToCollect = new HashSet<>(scopesToCollect);
         scopesToCollect.addAll(scopesToResolve);
 
-        DependencyFilter collectionFilter = new ScopeDependencyFilter(null, 
negate(scopesToCollect));
-        DependencyFilter resolutionFilter = new ScopeDependencyFilter(null, 
negate(scopesToResolve));
+        Collection<String> collectScopesToExclude = negate(scopesToCollect);
+        Collection<String> resolveScopesToExclude = negate(scopesToResolve);
+
+        DependencyFilter collectionFilter = new ScopeDependencyFilter(null, 
collectScopesToExclude);
+        DependencyFilter resolutionFilter = new ScopeDependencyFilter(null, 
resolveScopesToExclude);

Review Comment:
   can we just use the scopes to collect / resolve instead of the ones to 
exclude and give them as a negative test in the filter ?
   i.e.:
   ```
   DependencyFilter collectionFilter = new 
ScopeDependencyFilter(scopesToCollect);
   DependencyFilter resolutionFilter = new 
ScopeDependencyFilter(scopesToResolve);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to