Class BuildPlanExecutor

java.lang.Object
org.apache.maven.lifecycle.internal.concurrent.BuildPlanExecutor

@Named public class BuildPlanExecutor extends Object
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:

  1. Initial plan creation based on project dependencies and task segments
  2. Concurrent execution of build steps while maintaining dependency order
  3. Dynamic replanning when necessary (e.g., for forked executions)
  4. 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