[MNG-6981] Include the child projects (modules) of the selected projects with --pl in the reactor.

This closes #374.
This commit is contained in:
Martin Kanters 2020-09-09 18:12:31 +02:00
parent 87670ddc08
commit 42af8ba5a2
1 changed files with 7 additions and 1 deletions

View File

@ -180,7 +180,7 @@ public class DefaultGraphBuilder
{
File reactorDirectory = getReactorDirectory( request );
Collection<MavenProject> selectedProjects = new LinkedHashSet<>( request.getSelectedProjects().size(), 1 );
Collection<MavenProject> selectedProjects = new LinkedHashSet<>();
for ( String selector : request.getSelectedProjects() )
{
@ -190,6 +190,12 @@ public class DefaultGraphBuilder
.orElseThrow( () -> new MavenExecutionException(
"Could not find the selected project in the reactor: " + selector, request.getPom() ) );
selectedProjects.add( selectedProject );
List<MavenProject> children = selectedProject.getCollectedProjects();
if ( children != null )
{
selectedProjects.addAll( children );
}
}
result = new ArrayList<>( selectedProjects );