Class MultiThreadedBuilder
java.lang.Object
org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder
- All Implemented Interfaces:
Builder
@Component(role=Builder.class,
hint="multithreaded")
public class MultiThreadedBuilder
extends Object
implements Builder
Builds the full lifecycle in weave-mode (phase by phase as opposed to project-by-project).
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.
- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LifecycleModuleBuilder
private org.codehaus.plexus.logging.Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
build
(MavenSession session, ReactorContext reactorContext, ProjectBuildList projectBuilds, List<TaskSegment> taskSegments, ReactorBuildStatus reactorBuildStatus) private Callable<ProjectSegment>
createBuildCallable
(MavenSession rootSession, ProjectSegment projectBuild, ReactorContext reactorContext, TaskSegment taskSegment, ThreadOutputMuxer muxer, Set<String> duplicateArtifactIds) gatherDuplicateArtifactIds
(Set<MavenProject> projects) private void
multiThreadedProjectTaskSegmentBuild
(ConcurrencyDependencyGraph analyzer, ReactorContext reactorContext, MavenSession rootSession, CompletionService<ProjectSegment> service, TaskSegment taskSegment, Map<MavenProject, ProjectSegment> projectBuildList, ThreadOutputMuxer muxer)
-
Field Details
-
logger
@Requirement private org.codehaus.plexus.logging.Logger logger -
lifecycleModuleBuilder
-
-
Constructor Details
-
MultiThreadedBuilder
public MultiThreadedBuilder()
-
-
Method Details
-
build
public void build(MavenSession session, ReactorContext reactorContext, ProjectBuildList projectBuilds, List<TaskSegment> taskSegments, ReactorBuildStatus reactorBuildStatus) throws ExecutionException, InterruptedException - Specified by:
build
in interfaceBuilder
- Throws:
ExecutionException
InterruptedException
-
multiThreadedProjectTaskSegmentBuild
private void multiThreadedProjectTaskSegmentBuild(ConcurrencyDependencyGraph analyzer, ReactorContext reactorContext, MavenSession rootSession, CompletionService<ProjectSegment> service, TaskSegment taskSegment, Map<MavenProject, ProjectSegment> projectBuildList, ThreadOutputMuxer muxer) -
createBuildCallable
private Callable<ProjectSegment> createBuildCallable(MavenSession rootSession, ProjectSegment projectBuild, ReactorContext reactorContext, TaskSegment taskSegment, ThreadOutputMuxer muxer, Set<String> duplicateArtifactIds) -
gatherDuplicateArtifactIds
-