Make sure participants and session scope exit are called

Even in case of failing build.

Signed-off-by: Jason van Zyl <jason@tesla.io>
This commit is contained in:
Tamas Cservenak 2014-05-30 15:26:54 +02:00 committed by Jason van Zyl
parent 73d35ba959
commit 18964baa25
1 changed files with 31 additions and 33 deletions

View File

@ -336,17 +336,10 @@ public class DefaultMaven
//
projectDependencyGraph = createProjectDependencyGraph( session.getProjects(), request, result, false );
if ( result.hasExceptions() )
{
try
{
afterSessionEnd( projects, session );
}
catch ( MavenExecutionException e )
if ( result.hasExceptions() )
{
return addExceptionToResult( result, e );
}
return result;
}
@ -366,7 +359,9 @@ public class DefaultMaven
{
return addExceptionToResult( result, session.getResult().getExceptions().get( 0 ) );
}
}
finally
{
try
{
afterSessionEnd( projects, session );
@ -375,8 +370,11 @@ public class DefaultMaven
{
return addExceptionToResult( result, e );
}
finally
{
sessionScope.exit();
}
}
return result;
}