Class BuildPlanExecutor
java.lang.Object
org.apache.maven.lifecycle.internal.concurrent.BuildPlanExecutor
Executes the Maven build plan in a concurrent manner, handling the lifecycle phases and plugin executions.
This executor implements a weave-mode build strategy, where builds are executed phase-by-phase rather than
project-by-project.
Key Features:
- Concurrent execution of compatible build steps across projects
- Thread-safety validation for plugins
- Support for forked executions and lifecycle phases
- Dynamic build plan adjustment during execution
Execution Strategy:
The executor follows these main steps:
- Initial plan creation based on project dependencies and task segments
- Concurrent execution of build steps while maintaining dependency order
- Dynamic replanning when necessary (e.g., for forked executions)
- Project setup, execution, and teardown phases management
Thread Management:
The number of threads used is determined by:
min(degreeOfConcurrency, numberOfProjects)where degreeOfConcurrency is set via the -T command-line option.
Build Step States:
- CREATED: Initial state of a build step
- PLANNING: Step is being planned
- SCHEDULED: Step is queued for execution
- EXECUTED: Step has completed successfully
- FAILED: Step execution failed
NOTE: This class is not part of any public API and can be changed or deleted without prior notice.
- Since:
- 3.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBuildPlanExecutor
(MojoExecutor mojoExecutor, ExecutionEventCatapult eventCatapult, List<ProjectExecutionListener> listeners, TransformerManager transformerManager, BuildPlanLogger buildPlanLogger, Map<String, MojoExecutionConfigurator> mojoExecutionConfigurators, MavenPluginManager mavenPluginManager, MojoDescriptorCreator mojoDescriptorCreator, LifecycleRegistry lifecycles) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
attachToThread
(MavenProject currentProject) void
execute
(MavenSession session, ReactorContext reactorContext, List<TaskSegment> taskSegments)
-
Constructor Details
-
BuildPlanExecutor
@Inject public BuildPlanExecutor(@Named("concurrent") MojoExecutor mojoExecutor, ExecutionEventCatapult eventCatapult, List<ProjectExecutionListener> listeners, TransformerManager transformerManager, BuildPlanLogger buildPlanLogger, Map<String, MojoExecutionConfigurator> mojoExecutionConfigurators, MavenPluginManager mavenPluginManager, MojoDescriptorCreator mojoDescriptorCreator, LifecycleRegistry lifecycles)
-
-
Method Details
-
execute
public void execute(MavenSession session, ReactorContext reactorContext, List<TaskSegment> taskSegments) throws ExecutionException, InterruptedException -
attachToThread
-