configuration = Xpp3Dom.mergeXpp3Dom( new Xpp3Dom( (Xpp3Dom) phase.getConfiguration() ),
configuration );
}
MojoDescriptor desc = getMojoDescriptor( lifecyclePluginDescriptor, lifecycleGoal );
MojoExecution mojoExecution = new MojoExecution( desc, configuration );
addToLifecycleMappings( lifecycleMappings, phase.getId(), mojoExecution,
session.getSettings() );
}
}
if ( phase.getConfiguration() != null )
{
// Merge in general configuration for a phase.
// TODO: this is all kind of backwards from the POMM. Let's align it all under 2.1.
// We should create a new lifecycle executor for modelVersion >5.0.0
for ( Iterator j = lifecycleMappings.values().iterator(); j.hasNext(); )
{
List tasks = (List) j.next();
for ( Iterator k = tasks.iterator(); k.hasNext(); )
{
MojoExecution exec = (MojoExecution) k.next();
Xpp3Dom configuration = Xpp3Dom.mergeXpp3Dom(
new Xpp3Dom( (Xpp3Dom) phase.getConfiguration() ), exec.getConfiguration() );
exec.setConfiguration( configuration );
}
}
}
}
}
removeFromLifecycle( forkEntryPoints, lifecycleMappings );
}
MavenProject executionProject = new MavenProject( project );
if ( targetPhase != null )
{
Lifecycle lifecycle = getLifecycleForPhase( targetPhase );
executeGoalWithLifecycle( targetPhase, forkEntryPoints, session, lifecycleMappings, executionProject,
lifecycle );
}
else
{
String goal = mojoDescriptor.getExecuteGoal();
MojoDescriptor desc = getMojoDescriptor( pluginDescriptor, goal );
executeGoals( Collections.singletonList( new MojoExecution( desc ) ), forkEntryPoints, session,
executionProject );
}
project.setExecutionProject( executionProject );
}