mirror of https://github.com/apache/maven.git
[MNG-7102] The child modules of excluded projects are now excluded as well, making the behavior consistent with MNG-6981.
This commit is contained in:
parent
3e656376e8
commit
a02834611b
|
@ -255,7 +255,17 @@ public class DefaultGraphBuilder
|
|||
.findFirst()
|
||||
.orElseThrow( () -> new MavenExecutionException( "Could not find the selected project in "
|
||||
+ "the reactor: " + selector, request.getPom() ) );
|
||||
result.remove( excludedProject );
|
||||
|
||||
boolean isExcludedProjectRemoved = result.remove( excludedProject );
|
||||
|
||||
if ( isExcludedProjectRemoved )
|
||||
{
|
||||
List<MavenProject> children = excludedProject.getCollectedProjects();
|
||||
if ( children != null )
|
||||
{
|
||||
result.removeAll( children );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -147,6 +147,9 @@ public class DefaultGraphBuilderTest
|
|||
.excludedProjects( MODULE_B )
|
||||
.makeBehavior( REACTOR_MAKE_UPSTREAM )
|
||||
.expectResult( PARENT_MODULE, MODULE_C, MODULE_A, MODULE_C_2 ),
|
||||
scenario( "Excluding a project also excludes its children" )
|
||||
.excludedProjects( MODULE_C )
|
||||
.expectResult( PARENT_MODULE, MODULE_A, MODULE_B, INDEPENDENT_MODULE ),
|
||||
scenario( "Excluding an also make dependency from resumeFrom does take its transitive dependency" )
|
||||
.resumeFrom( MODULE_C_2 )
|
||||
.excludedProjects( MODULE_B )
|
||||
|
|
Loading…
Reference in New Issue