mirror of https://github.com/apache/maven.git
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:
parent
73d35ba959
commit
18964baa25
|
@ -336,17 +336,10 @@ public class DefaultMaven
|
||||||
//
|
//
|
||||||
projectDependencyGraph = createProjectDependencyGraph( session.getProjects(), request, result, false );
|
projectDependencyGraph = createProjectDependencyGraph( session.getProjects(), request, result, false );
|
||||||
|
|
||||||
if ( result.hasExceptions() )
|
|
||||||
{
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
afterSessionEnd( projects, session );
|
if ( result.hasExceptions() )
|
||||||
}
|
|
||||||
catch ( MavenExecutionException e )
|
|
||||||
{
|
{
|
||||||
return addExceptionToResult( result, e );
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,7 +359,9 @@ public class DefaultMaven
|
||||||
{
|
{
|
||||||
return addExceptionToResult( result, session.getResult().getExceptions().get( 0 ) );
|
return addExceptionToResult( result, session.getResult().getExceptions().get( 0 ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
afterSessionEnd( projects, session );
|
afterSessionEnd( projects, session );
|
||||||
|
@ -375,8 +370,11 @@ public class DefaultMaven
|
||||||
{
|
{
|
||||||
return addExceptionToResult( result, e );
|
return addExceptionToResult( result, e );
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
sessionScope.exit();
|
sessionScope.exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue