[maven-4.0.x] Fix #12704: Do not report an independent, built module as skipped - #12706
Merged
slachiewicz merged 2 commits intoAug 8, 2026
Conversation
When the reactor is halted after a module fails, the concurrent builder turned every project that had not yet run its whole plan into a skipped one. The plan holds a step for every phase of the lifecycle, so a project that had already run everything the requested tasks asked of it still had empty steps left for the phases beyond them; those got skipped along with the rest, and the project was reported as ProjectSkipped even though it had built successfully and written its output. Base the outcome on the steps that carry mojo executions instead: a project that ran all of its work is reported as succeeded, one that still had work pending stays skipped, and a project whose setup never ran was never started and stays skipped as well. The accompanying log line always blamed a failed dependency, which is the only reason the legacy builder ever had. A halted project usually has no failed dependency at all, so tell the two cases apart and say which one it is.
gnodet
approved these changes
Aug 8, 2026
gnodet
left a comment
Contributor
There was a problem hiding this comment.
Clean cherry-pick backport of PR #12705 to maven-4.0.x. Both commits are included (the main fix and the follow-up unit tests for hasExecutions()). The code changes are identical to the approved master PR, and all referenced APIs (BuildPlan.step(), BuildStep.skip()/hasExecutions(), ProjectDependencyGraph.getUpstreamProjects()) resolve correctly on the 4.0.x branch.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #12705 to
maven-4.0.x. Fixes #12704 on the release branch — the code is identical there, so the bug ships in 4.0.0-rc-4 through rc-6.The cherry-pick applied without conflicts.
What it fixes
BuildPlanExecutor'sTEARDOWNdecided betweenProjectSucceededandProjectSkippedonallStepsExecuted, which required every step of a project's plan to have reachedEXECUTED. The plan holds a step for every phase of the lifecycle regardless of the requested tasks, so a project keeps empty steps for the phases beyond them; a halted reactor skips those, and a project that had already finished everything asked of it was reported as skipped. The decision is now based on the steps that carry mojo executions, plus a check that the project'sSETUPran at all.The accompanying log line always blamed a failed dependency, which is untrue for a project stopped by an unrelated failure.
ExecutionEventLoggernow tells the two cases apart.Verification on this branch
MavenITmng8648ProjectEventsTestpasses against the patched 4.0.0-SNAPSHOT distribution:subproject-aandsubproject-bsucceed,subproject-cfails,subproject-dis skipped and keeps the dependency message.impl/maven-coreandimpl/maven-cliare green (621 tests),spotless:checkclean.Not addressed here
MavenITmng8648ProjectEventsTeststays timing-sensitive: ifsubproject-cfails beforesubproject-b's steps are scheduled at all,bis legitimately skipped and the assertion onProjectSucceededstill fails. That needs an ordering guarantee in the test rather than a change in core.