diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java index 5376e36d46..7b6a5dea39 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleStarter.java @@ -112,7 +112,7 @@ public class LifecycleStarter } logger.info( "" ); - logger.info( String.format( "Using the builder %s", builder.getClass().getName() ) ); + logger.info( String.format( "Using the builder %s with a thread count of %s", builder.getClass().getName(), session.getRequest().getDegreeOfConcurrency() ) ); builder.build( session, reactorContext, projectBuilds, taskSegments, reactorBuildStatus ); } diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java index f07ba4fb4e..f7d72d78b9 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java @@ -1087,15 +1087,24 @@ public class MavenCli if ( threadConfiguration != null ) { + // + // Default to the standard multithreaded builder + // request.setBuilderId( "multithreaded" ); - - int threads = - threadConfiguration.contains( "C" ) ? Integer.valueOf( threadConfiguration.replace( "C", "" ) ) - * Runtime.getRuntime().availableProcessors() : Integer.valueOf( threadConfiguration ); - - request.setDegreeOfConcurrency( threads ); - } - + + if ( threadConfiguration.contains( "C" ) ) + { + request.setDegreeOfConcurrency( (int) ( Float.valueOf( threadConfiguration.replace( "C", "" ) ) * Runtime.getRuntime().availableProcessors() ) ); + } + else + { + request.setDegreeOfConcurrency( Integer.valueOf( threadConfiguration ) ); + } + } + + // + // Allow the builder to be overriden by the user if requested. The builders are now pluggable. + // if ( commandLine.hasOption( CLIManager.BUILDER ) ) { request.setBuilderId( commandLine.getOptionValue( CLIManager.BUILDER ) );