diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuilderCommon.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuilderCommon.java index 2e63647487..a0187378b6 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuilderCommon.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuilderCommon.java @@ -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 } -} \ No newline at end of file +} diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java index fe69c0a120..a0056b42a9 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java @@ -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 { diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleWeaveBuilder.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleWeaveBuilder.java index 12058e5307..4b267282fe 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleWeaveBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleWeaveBuilder.java @@ -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 {