From 02265b1ef56d8d7d7613ab1d77869fc52a3742a1 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Sat, 28 Mar 2009 18:30:22 +0000 Subject: [PATCH] o take the reactor manager out of more signatures, it's contained in the session so we don't need to pass around both git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@759545 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/lifecycle/DefaultLifecycleExecutor.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java index 1495277c90..f379f1f170 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java @@ -124,7 +124,7 @@ public class DefaultLifecycleExecutor for ( String goal : goals ) { String target = currentProject.getId() + " ( " + goal + " )"; - executeGoalAndHandleFailures( goal, session, currentProject, session.getReactorManager(), buildStartTime, target ); + executeGoalAndHandleFailures( goal, session, currentProject, buildStartTime, target ); } } finally @@ -137,7 +137,7 @@ public class DefaultLifecycleExecutor } } - private void executeGoalAndHandleFailures( String task, MavenSession session, MavenProject project, ReactorManager rm, long buildStartTime, String target ) + private void executeGoalAndHandleFailures( String task, MavenSession session, MavenProject project, long buildStartTime, String target ) throws BuildFailureException, LifecycleExecutionException { try @@ -146,22 +146,25 @@ public class DefaultLifecycleExecutor } catch ( LifecycleExecutionException e ) { - if ( handleExecutionFailure( rm, project, e, task, buildStartTime ) ) + if ( handleExecutionFailure( session, project, e, task, buildStartTime ) ) { throw e; } } catch ( BuildFailureException e ) { - if ( handleExecutionFailure( rm, project, e, task, buildStartTime ) ) + if ( handleExecutionFailure( session, project, e, task, buildStartTime ) ) { throw e; } } } - private boolean handleExecutionFailure( ReactorManager rm, MavenProject project, Exception e, String task, long buildStartTime ) + private boolean handleExecutionFailure( MavenSession session, MavenProject project, Exception e, String task, long buildStartTime ) { + //TODO: we shouldn't be registering build failures with the reactor manager, it should be in the session. + ReactorManager rm = session.getReactorManager(); + rm.registerBuildFailure( project, e, task, System.currentTimeMillis() - buildStartTime ); if ( ReactorManager.FAIL_FAST.equals( rm.getFailureBehavior() ) )