diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java index 94d10af4b4..2688a6b435 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java @@ -186,12 +186,23 @@ public class MultiThreadedBuilder { public ProjectSegment call() { - // muxer.associateThreadWithProjectSegment( projectBuild ); - lifecycleModuleBuilder.buildProject( projectBuild.getSession(), rootSession, reactorContext, - projectBuild.getProject(), taskSegment ); - // muxer.setThisModuleComplete( projectBuild ); + final Thread currentThread = Thread.currentThread(); + final String originalThreadName = currentThread.getName(); + currentThread.setName( "mvn-builder-" + projectBuild.getProject().getId() ); - return projectBuild; + try + { + // muxer.associateThreadWithProjectSegment( projectBuild ); + lifecycleModuleBuilder.buildProject( projectBuild.getSession(), rootSession, reactorContext, + projectBuild.getProject(), taskSegment ); + // muxer.setThisModuleComplete( projectBuild ); + + return projectBuild; + } + finally + { + currentThread.setName( originalThreadName ); + } } }; }