@Component(role=Builder.class, hint="multithreaded") public class MultiThreadedBuilder extends java.lang.Object implements Builder
This builder uses a number of threads equal to the minimum of the degree of concurrency (which is the thread count
set with -T
on the command-line) and the number of projects to build. As such, building a single project
will always result in a sequential build, regardless of the thread count.
Modifier and Type | Field and Description |
---|---|
private LifecycleModuleBuilder |
lifecycleModuleBuilder |
private org.codehaus.plexus.logging.Logger |
logger |
Constructor and Description |
---|
MultiThreadedBuilder() |
Modifier and Type | Method and Description |
---|---|
void |
build(MavenSession session,
ReactorContext reactorContext,
ProjectBuildList projectBuilds,
java.util.List<TaskSegment> taskSegments,
ReactorBuildStatus reactorBuildStatus) |
private java.util.concurrent.Callable<ProjectSegment> |
createBuildCallable(MavenSession rootSession,
ProjectSegment projectBuild,
ReactorContext reactorContext,
TaskSegment taskSegment,
ThreadOutputMuxer muxer,
java.util.Set<java.lang.String> duplicateArtifactIds) |
private java.util.Set<java.lang.String> |
gatherDuplicateArtifactIds(java.util.Set<MavenProject> projects) |
private void |
multiThreadedProjectTaskSegmentBuild(ConcurrencyDependencyGraph analyzer,
ReactorContext reactorContext,
MavenSession rootSession,
java.util.concurrent.CompletionService<ProjectSegment> service,
TaskSegment taskSegment,
java.util.Map<MavenProject,ProjectSegment> projectBuildList,
ThreadOutputMuxer muxer) |
@Requirement private org.codehaus.plexus.logging.Logger logger
@Requirement private LifecycleModuleBuilder lifecycleModuleBuilder
public void build(MavenSession session, ReactorContext reactorContext, ProjectBuildList projectBuilds, java.util.List<TaskSegment> taskSegments, ReactorBuildStatus reactorBuildStatus) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
private void multiThreadedProjectTaskSegmentBuild(ConcurrencyDependencyGraph analyzer, ReactorContext reactorContext, MavenSession rootSession, java.util.concurrent.CompletionService<ProjectSegment> service, TaskSegment taskSegment, java.util.Map<MavenProject,ProjectSegment> projectBuildList, ThreadOutputMuxer muxer)
private java.util.concurrent.Callable<ProjectSegment> createBuildCallable(MavenSession rootSession, ProjectSegment projectBuild, ReactorContext reactorContext, TaskSegment taskSegment, ThreadOutputMuxer muxer, java.util.Set<java.lang.String> duplicateArtifactIds)
private java.util.Set<java.lang.String> gatherDuplicateArtifactIds(java.util.Set<MavenProject> projects)