[MNG-6471] Parallel builder should use the module name as thread name

This closes #177
This commit is contained in:
Romain Manni-Bucau 2018-09-06 11:08:14 +02:00 committed by Michael Osipov
parent b23116d626
commit a242c1a912
1 changed files with 16 additions and 5 deletions

View File

@ -186,6 +186,12 @@ public class MultiThreadedBuilder
final TaskSegment taskSegment, final ThreadOutputMuxer muxer )
{
return () ->
{
final Thread currentThread = Thread.currentThread();
final String originalThreadName = currentThread.getName();
currentThread.setName( "mvn-builder-" + projectBuild.getProject().getId() );
try
{
// muxer.associateThreadWithProjectSegment( projectBuild );
lifecycleModuleBuilder.buildProject( projectBuild.getSession(), rootSession, reactorContext,
@ -193,6 +199,11 @@ public class MultiThreadedBuilder
// muxer.setThisModuleComplete( projectBuild );
return projectBuild;
}
finally
{
currentThread.setName( originalThreadName );
}
};
}
}