Repository navigation
[Backport 4.0.x] Fix modello velocity phase for concurrent builder compatibility - #12963
Merged
Merged
Conversation
…ilder compatibility (#12687) In the Maven 4 graph lifecycle model, the SOURCES and RESOURCES phases are parallel siblings under BUILD, and COMPILE depends on SOURCES (via after(SOURCES)) but not on RESOURCES. The modello velocity goal generates Java source files, but was bound to generate-resources (mapped to the RESOURCES phase), creating a race condition with the concurrent builder (-b concurrent): COMPILE could start before the velocity goal finished generating Java sources. This caused "package does not exist" compilation errors when running `mvn build -T1C -b concurrent` without clean, because upstream modules built fast enough (incremental) that COMPILE started before modello had called addCompileSourceRoot(). With clean, upstream rebuilds took longer, masking the race. Split the modello execution so velocity (Java source generation) runs at generate-sources (SOURCES phase) and xdoc/xsd (documentation) stay at generate-resources (RESOURCES phase), matching the pattern already used by maven-api-model. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
gnodet
commented
Aug 31, 2026
gnodet
left a comment
Contributor
Author
There was a problem hiding this comment.
✅ Looks Good
Clean backport of #12687 (master → maven-4.0.x). The cherry-pick is byte-identical to the original commit (852e66a), targets exactly the two modules with the race condition, and the fix is semantically sound — velocity generates Java sources so it belongs at generate-sources, while xdoc/xsd generate documentation resources and correctly stay at generate-resources.
Verification notes:
- Checked all modello-using modules on
maven-4.0.x: onlymaven-api-settingsandmaven-api-toolchainhad velocity bound togenerate-resources; all other modules (maven-api-cli,maven-api-metadata,maven-api-model,maven-api-plugin, compat modules) already usegenerate-sources. The fix is complete. - The new execution ID
modello-docsis clear, descriptive, and does not conflict with any existing execution ID in these modules. - No backport to 3.x branches is needed — the concurrent builder's graph lifecycle model (parallel SOURCES/RESOURCES phases) is Maven 4-only.
📋 PR Metadata
| Aspect | Current | Suggested |
|---|---|---|
| Labels | (none) | bug |
| Milestone | (none) | 4.0.0-rc-7 |
🤖 This review was generated by ForgeBot.
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.
Summary
Backport of #12687 to
maven-4.0.x.maven-api-settingsandmaven-api-toolchainso thevelocitygoal (Java source generation) runs atgenerate-sourcesinstead ofgenerate-resources, whilexdoc/xsd(documentation) remain atgenerate-resources-b concurrent) whereCOMPILEcould start beforevelocityfinished generating Java source files, causing"package does not exist"compilation errorsDetails
In Maven 4's graph lifecycle model,
SOURCESandRESOURCESare parallel siblings underBUILD, andCOMPILEis orderedafter(SOURCES)but notafter(RESOURCES). The modellovelocitygoal generates Java source files but was bound togenerate-resources(→RESOURCESphase), creating a race whereCOMPILEcould start before source generation finished.Cherry-picked cleanly from master (852e66a).
Test plan
maven-4.0.x🤖 Generated with Claude Code