[MNG-5208] Parallel (-T option) multi module build fires wrong project failed event

Patch by Stefan Eder , applied with minor modifications
This commit is contained in:
Kristian Rosenvold 2012-12-01 21:30:57 +01:00
parent 327e1b7e80
commit 75ea1e4297
3 changed files with 9 additions and 10 deletions

View File

@ -48,7 +48,7 @@ import java.util.Set;
/**
* Common code that is shared by the LifecycleModuleBuilder and the LifeCycleWeaveBuilder
*
*
* @since 3.0
* @author Kristian Rosenvold
* Builds one or more lifecycles for a full module
@ -133,9 +133,8 @@ public class BuilderCommon
return executionPlan;
}
public void handleBuildError( final ReactorContext buildContext, final MavenSession rootSession,
final MavenProject mavenProject, Exception e, final long buildStartTime )
{
public void handleBuildError(final ReactorContext buildContext, final MavenSession rootSession, final MavenSession currentSession,
final MavenProject mavenProject, Exception e, final long buildStartTime) {
if ( e instanceof RuntimeException )
{
e = new InternalErrorException( "Internal error: " + e, e );
@ -147,7 +146,7 @@ public class BuilderCommon
buildContext.getResult().addBuildSummary( new BuildFailure( mavenProject, buildEndTime - buildStartTime, e ) );
eventCatapult.fire( ExecutionEvent.Type.ProjectFailed, rootSession, null, e );
eventCatapult.fire( ExecutionEvent.Type.ProjectFailed, currentSession, null, e );
if ( MavenExecutionRequest.REACTOR_FAIL_NEVER.equals( rootSession.getReactorFailureBehavior() ) )
{
@ -187,4 +186,4 @@ public class BuilderCommon
}
}
}

View File

@ -32,7 +32,7 @@ import java.util.HashSet;
/**
* Builds one or more lifecycles for a full module
*
*
* @since 3.0
* @author Benjamin Bentmann
* @author Jason van Zyl
@ -92,7 +92,7 @@ public class LifecycleModuleBuilder
}
catch ( Exception e )
{
builderCommon.handleBuildError( reactorContext, rootSession, currentProject, e, buildStartTime );
builderCommon.handleBuildError(reactorContext, rootSession, session, currentProject, e, buildStartTime);
}
finally
{

View File

@ -277,8 +277,8 @@ public class LifecycleWeaveBuilder
}
catch ( Exception e )
{
builderCommon.handleBuildError( reactorContext, rootSession, projectBuild.getProject(), e,
buildStartTime );
builderCommon.handleBuildError( reactorContext, rootSession, projectBuild.getSession(),
projectBuild.getProject(), e, buildStartTime );
}
finally
{