Skip to content

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 26, 2025

JIRA issue: MNG-8653

Fixes the existing 'all' phase and introduces a new 'each' phase to better support
hierarchical builds and concurrent execution:

  • 'all': Properly coordinates execution across parent-child project hierarchies
  • 'each': A new phase that executes for each individual project in isolation

Key changes:

  • Enhanced BuildPlanExecutor to properly handle parent-child relationships in phases
  • Added new children() pointer type for explicit phase dependencies
  • Improved phase dependency management to ensure:
    • Parent's before:all executes before children's phases
    • Children's after:all executes before parent's after:all
    • Each project's phases execute in isolation within the 'each' phase
  • Added comprehensive documentation to BuildPlanExecutor
  • Added integration test to verify hierarchical phase execution

This commit also fixes thread-safety issues in concurrent builds:

  • Added synchronization to ReactorReader for project operations
  • Improved thread-safety for project-level clean and install operations
  • Enhanced build step state management in concurrent scenarios

Fixes: MNG-8653

@gnodet gnodet changed the title Fix all phase and add each phase [MNG-8653] Fix all phase and add each phase Mar 26, 2025
@gnodet gnodet changed the title [MNG-8653] Fix all phase and add each phase [MNG-8653] Fix 'all' phase and add 'each' phase Mar 27, 2025
@gnodet gnodet marked this pull request as ready for review March 27, 2025 12:07
@gnodet gnodet added this to the 4.0.0-rc-4 milestone Mar 27, 2025
@gnodet gnodet force-pushed the all-each-phases branch 3 times, most recently from d70e4a8 to 2a1da75 Compare March 28, 2025 12:29
# Conflicts:
#	impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlanExecutor.java
#	its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java
@gnodet gnodet merged commit 35e10b8 into apache:master Mar 28, 2025
13 checks passed
@Bukama Bukama added bug Something isn't working and removed maintenance labels Jun 19, 2025
@jira-importer
Copy link

Resolve #9658

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants