-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Repository management fixes #11238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Repository management fixes #11238
Conversation
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
This reverts commit 7379ac8.
…javadoc - Renamed RemoteRepositoryRequest to RepositoryAwareRequest for better clarity - The name now reflects that these are requests that are 'aware of' repositories - Avoids confusion with requests 'for' repositories themselves - Enhanced javadoc with comprehensive documentation: - Clear description of the interface purpose and usage - Detailed explanation of repository validation logic - Better parameter and return value documentation - Improved exception messages with specific details about validation failures - Updated all implementing interfaces to use the new name
4d9a174 to
7abeac8
Compare
gnodet
approved these changes
Oct 10, 2025
gnodet
pushed a commit
to gnodet/maven
that referenced
this pull request
Oct 10, 2025
…handling (apache#11238) This change introduces a new RepositoryAwareRequest interface that consolidates repository handling across multiple Maven service request types, addressing issues with duplicate repositories being passed to resolvers. Key changes: * Add RepositoryAwareRequest interface with repository validation: - Provides getRepositories() method and validate() logic - Prevents duplicate repositories and null entries - Consolidates common repository functionality * Refactor service request interfaces to extend RepositoryAwareRequest: - ArtifactResolverRequest, DependencyResolverRequest, ModelBuilderRequest - ProjectBuilderRequest, VersionRangeResolverRequest, VersionResolverRequest - Apply repository validation in all implementations * Fix repository leakage in DefaultProjectBuilder: - Store project-specific repositories in BuildSession - Implement proper repository merging based on strategy - Prevent cross-contamination between sibling projects * Update resolvers to use toResolvingRepositories() for consistent handling * Add RepositoryLeakageTest to verify proper isolation between projects This eliminates duplicate repositories being sent to resolvers and ensures consistent repository handling across all Maven service requests. (cherry picked from commit f634360)
Contributor
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
gnodet
added a commit
that referenced
this pull request
Oct 10, 2025
…handling (#11238) (#11244) This change introduces a new RepositoryAwareRequest interface that consolidates repository handling across multiple Maven service request types, addressing issues with duplicate repositories being passed to resolvers. Key changes: * Add RepositoryAwareRequest interface with repository validation: - Provides getRepositories() method and validate() logic - Prevents duplicate repositories and null entries - Consolidates common repository functionality * Refactor service request interfaces to extend RepositoryAwareRequest: - ArtifactResolverRequest, DependencyResolverRequest, ModelBuilderRequest - ProjectBuilderRequest, VersionRangeResolverRequest, VersionResolverRequest - Apply repository validation in all implementations * Fix repository leakage in DefaultProjectBuilder: - Store project-specific repositories in BuildSession - Implement proper repository merging based on strategy - Prevent cross-contamination between sibling projects * Update resolvers to use toResolvingRepositories() for consistent handling * Add RepositoryLeakageTest to verify proper isolation between projects This eliminates duplicate repositories being sent to resolvers and ensures consistent repository handling across all Maven service requests. (cherry picked from commit f634360) Co-authored-by: Tamas Cservenak <tamas@cservenak.net>
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.
Maven 4 wrongly issued resolver requests with mismanaged list of remote repositories (duplicates), and while this was not "deadly", this causes several issues like cache misses and cache inflation (as requests for same artifact but duplicate repositories causes cache miss).