AlexanderAshitkin commented on a change in pull request #290: [MNG-6774] - 
Speedup project graph build by paralleling operations
URL: https://github.com/apache/maven/pull/290#discussion_r383054404
 
 

 ##########
 File path: 
maven-core/src/main/java/org/apache/maven/graph/DefaultGraphBuilder.java
 ##########
 @@ -401,18 +403,49 @@ else if ( selectedProject.isDirectory() )
             return projects;
         }
 
-        List<File> files = Arrays.asList( request.getPom().getAbsoluteFile() );
+        List<File> files = Collections.singletonList( 
request.getPom().getAbsoluteFile() );
         collectProjects( projects, files, request );
         return projects;
     }
 
-    private void collectProjects( List<MavenProject> projects, List<File> 
files, MavenExecutionRequest request )
-        throws ProjectBuildingException
+    private void collectProjects( List<MavenProject> projects, final 
List<File> files,
+                                  final MavenExecutionRequest request ) throws 
ProjectBuildingException
     {
-        ProjectBuildingRequest projectBuildingRequest = 
request.getProjectBuildingRequest();
+        final ProjectBuildingRequest projectBuildingRequest = 
request.getProjectBuildingRequest();
+
+        List<ProjectBuildingResult> results;
+        long start = System.currentTimeMillis();
+        if ( request.getDegreeOfConcurrency() <= 1 || Boolean.getBoolean( 
"maven.concurrentGraph.disable" ) )
 
 Review comment:
   Hi
   in any case need to cap resources allocated at this step as build owner 
needs to control his environment. if user set -T flag we can assume he gave 
consent that build can use up to those CPU resources . So using 
DegreeOfConcurrency sounds natural for me. To make it more fine grained it is 
possible to introduce additional control flags, but i decided to not complicate 
configuration at this point

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to