Repository navigation
Conversation
* Wire ModelBuilderRequest.isLocationTracking() to XML parser Add isAddLocationInformation() to XmlReaderRequest and wire it to MavenStaxReader so callers can skip location tracking when not needed. DefaultModelBuilder propagates the flag from ModelBuilderRequest to the XML parser, and forwards the parent's setting to BOM import sub-requests instead of hardcoding it off. Co-Authored-By: Claude Opus 4.6 <[email protected]> * Remove premature wiring of isLocationTracking() to XML parser Do not pass ModelBuilderRequest.isLocationTracking() as the addLocationInformation flag for XmlReaderRequest. These are different concerns: - isLocationTracking() controls whether the model building pipeline retains location data (used by DefaultDependencyManagementImporter and DefaultProjectBuilder) - isAddLocationInformation() controls whether the XML parser tracks line/column positions during parsing Wiring one to the other broke hasSubprojectsDefined(), which relies on model.getLocation("modules") to detect <modules> presence. When DefaultConsumerPomBuilder sets locationTracking(false) for consumer POM generation, the XML parser skipped location tracking, causing spurious auto-discovery of subprojects alongside explicit <modules> entries. The XmlReaderRequest API + DefaultModelXmlFactory wiring remain as correct infrastructure for future selective optimization by callers who know they don't need XML-level locations. Co-Authored-By: Claude Opus 4.6 <[email protected]> * Add maven.project.discoverSubprojects property to replace location-based opt-out Replace the fragile location-tracking-based detection of empty <modules/> elements with a simple non-empty list check, and add a new user property (maven.project.discoverSubprojects) as the explicit opt-out mechanism for subproject auto-discovery. The previous approach relied on model.getLocation("modules") != null to distinguish "no <modules> element" from "empty <modules/> element", which broke whenever location tracking was disabled (e.g. by DefaultConsumerPomBuilder). The new approach: - hasSubprojectsDefined() now checks !getSubprojects().isEmpty() || !getModules().isEmpty() - Users who want to suppress auto-discovery without listing subprojects can set -Dmaven.project.discoverSubprojects=false - ModelBuilderRequest.locationTracking default reverted to false since subproject detection no longer depends on it Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
Contributor
Author
|
Closing: cherry-pick was contaminated with unrelated changes from master. Will redo the backport cleanly. |
1 of 2 tasks
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 #12655 to maven-4.0.x.
Original PR: #12655