mthmulders commented on a change in pull request #373:
URL: https://github.com/apache/maven/pull/373#discussion_r487562212
##########
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 thought I replied to this one already... Can't find it though.
In fact, the old code already had strategies, except they weren't
implemented in separate classes, just all in this class. It wasn't very obvious
from the old code, but in fact, it already employed two strategies: if there's
no POM (say when you run `archetype:generate`) or when there is a POM. If the
former would fail, the second would take over. Now that we're adding a third
strategy, we felt we'd make this structure more explicit, including the fact
that the strategies are executed one after each other.
----------------------------------------------------------------
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]