Slight addition to MNG-5389 so that the afterSessionEnd method throws a MavenExecutionException like the other methods in the participant

This commit is contained in:
Jason van Zyl 2014-01-24 11:36:50 -05:00
parent 8f3eca3d0f
commit b05dd063f9
2 changed files with 19 additions and 3 deletions

View File

@ -66,6 +66,7 @@ public abstract class AbstractMavenLifecycleParticipant
* code.
*/
public void afterSessionEnd( MavenSession session )
throws MavenExecutionException
{
// do nothing
}

View File

@ -317,7 +317,14 @@ public class DefaultMaven
if ( result.hasExceptions() )
{
afterSessionEnd( projects, session );
try
{
afterSessionEnd( projects, session );
}
catch (MavenExecutionException e)
{
return addExceptionToResult( result, e );
}
return result;
}
@ -339,12 +346,20 @@ public class DefaultMaven
return addExceptionToResult( result, session.getResult().getExceptions().get( 0 ) );
}
afterSessionEnd( projects, session );
try
{
afterSessionEnd( projects, session );
}
catch (MavenExecutionException e)
{
return addExceptionToResult( result, e );
}
return result;
}
private void afterSessionEnd( Collection<MavenProject> projects, MavenSession session )
private void afterSessionEnd( Collection<MavenProject> projects, MavenSession session )
throws MavenExecutionException
{
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
try