[MNG-7793] Add generated-source metadata to Maven 4 APIs - #12958
Conversation
gnodet
left a comment
There was a problem hiding this comment.
We need to target Maven 4.1.0, hence the model version 4.2.0.
|
Thanks @gnodet. Updated the |
|
One more thing to address, please rebase and squash commits |
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
496cca0 to
3bf6edd
Compare
|
@slachiewicz Rebased onto the latest master and squashed the changes into a single signed commit. Thanks for the review.! |
…VE, no review posted - all FP)
gnodet
left a comment
There was a problem hiding this comment.
The generated attribute is properly threaded through all layers — model (4.2.0+), API (SourceRoot.generated()), service (ProjectManager.addSourceRoot overload), implementation (DefaultSourceRoot, DefaultProjectManager, ConnectedResource), and serialization (XML round-trip, consumer POM).
Backward compatibility is maintained via the bridging constructor that defaults generated to false. The duplicate-check logic in DefaultProjectManager.addSourceRoot correctly uses scope+language+directory as the key (excluding generated), preserving first-registration-wins semantics. Tests cover all the interesting cases: generated registration, duplicate handling, legacy non-generated default, resource mutation preservation, and XML round-trip in the 4.2.0 namespace.
The model version targeting (4.2.0+) addresses the earlier review feedback.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Fixes #9196
Summary
Add explicit generated-source metadata to Maven 4's source model and APIs so plugins can distinguish generated files without relying on directory naming conventions.
Implementation
generatedattribute toorg.apache.maven.api.model.Source.SourceRoot.ProjectManager.Verification
mvn --batch-mode verifyFollowing this checklist to help us incorporate your contribution quickly and easily:
mvn verifypasses.