mirror of https://github.com/apache/maven.git
Fix for multithreading configuration where you have something like -TC2.2
This commit is contained in:
parent
d8c57c441d
commit
30fadd074e
|
@ -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 );
|
||||
|
||||
}
|
||||
|
|
|
@ -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 ) );
|
||||
|
|
Loading…
Reference in New Issue