rfscholte commented on a change in pull request #373:
URL: https://github.com/apache/maven/pull/373#discussion_r490777717



##########
File path: 
maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java
##########
@@ -361,76 +406,35 @@ private File getReactorDirectory( MavenExecutionRequest 
request )
         throws ProjectBuildingException
     {
         MavenExecutionRequest request = session.getRequest();
-
         request.getProjectBuildingRequest().setRepositorySession( 
session.getRepositorySession() );
 
-        List<MavenProject> projects = new ArrayList<>();
+        List<ProjectCollectionStrategy> projectCollectionStrategies = 
Arrays.asList(
+                projectlessCollectionStrategy, // 1. Collect project for 
invocation without a POM.
+                multiModuleCollectionStrategy, // 2. Collect projects for all 
modules in the multi-module project.
+                requestPomCollectionStrategy   // 3. Collect projects for 
explicitly requested POM.
+        );
 
-        // We have no POM file.
-        //
-        if ( request.getPom() == null )
+        for ( ProjectCollectionStrategy strategy : projectCollectionStrategies 
)

Review comment:
       I don't mind moving the logic to separate classes, that'll probably 
improve readability and testability.
   I really prefer to make the choice of the strategy explicit instead of 
magically breaking out of a for-loop.
   It will also make it easier to identify the awkward usecase, making the 
discussion easier to drop this support in the future.
   




----------------------------------------------------------------
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.

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


Reply via email to