mirror of https://github.com/apache/maven.git
[MNG-4327] [regression] Forking mojos that are bound to a lifecycle phase that gets forked execute multiple times
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@808556 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7e24255ab4
commit
6da9bf5c0a
|
@ -984,6 +984,8 @@ public class DefaultLifecycleExecutor
|
||||||
|
|
||||||
mojoExecution.addForkedExecutions( getKey( forkedProject ), forkedExecutions );
|
mojoExecution.addForkedExecutions( getKey( forkedProject ), forkedExecutions );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alreadyForkedExecutions.remove( mojoDescriptor );
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<MojoExecution> calculateForkedGoal( MojoExecution mojoExecution, MavenSession session,
|
private List<MojoExecution> calculateForkedGoal( MojoExecution mojoExecution, MavenSession session,
|
||||||
|
@ -1005,6 +1007,11 @@ public class DefaultLifecycleExecutor
|
||||||
throw new MojoNotFoundException( forkedGoal, pluginDescriptor );
|
throw new MojoNotFoundException( forkedGoal, pluginDescriptor );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( alreadyForkedExecutions.contains( forkedMojoDescriptor ) )
|
||||||
|
{
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
MojoExecution forkedExecution = new MojoExecution( forkedMojoDescriptor, forkedGoal );
|
MojoExecution forkedExecution = new MojoExecution( forkedMojoDescriptor, forkedGoal );
|
||||||
|
|
||||||
populateMojoExecutionConfiguration( project, forkedExecution, true );
|
populateMojoExecutionConfiguration( project, forkedExecution, true );
|
||||||
|
@ -1052,13 +1059,18 @@ public class DefaultLifecycleExecutor
|
||||||
|
|
||||||
for ( List<MojoExecution> forkedExecutions : lifecycleMappings.values() )
|
for ( List<MojoExecution> forkedExecutions : lifecycleMappings.values() )
|
||||||
{
|
{
|
||||||
for ( MojoExecution forkedExecution : forkedExecutions )
|
for ( Iterator<MojoExecution> it = forkedExecutions.iterator(); it.hasNext(); )
|
||||||
{
|
{
|
||||||
extractMojoConfiguration( forkedExecution );
|
MojoExecution forkedExecution = it.next();
|
||||||
|
|
||||||
calculateForkedExecutions( forkedExecution, session, project, alreadyForkedExecutions );
|
if ( !alreadyForkedExecutions.contains( forkedExecution.getMojoDescriptor() ) )
|
||||||
|
{
|
||||||
|
extractMojoConfiguration( forkedExecution );
|
||||||
|
|
||||||
mojoExecutions.add( forkedExecution );
|
calculateForkedExecutions( forkedExecution, session, project, alreadyForkedExecutions );
|
||||||
|
|
||||||
|
mojoExecutions.add( forkedExecution );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue