Limit name-based repo duplicate check to URL-less repositories#7245
Merged
Limit name-based repo duplicate check to URL-less repositories#7245
Conversation
The name-based fallback added in #7230 incorrectly blocks adding a second `maven {}` or `ivy {}` repository with a different URL, since it only checks the method name. Gate the check on `url == null` so it only applies to uniquely-named repositories like `gradlePluginPortal`, `mavenCentral`, `mavenLocal`, and `google`.
timtebeek
approved these changes
Apr 2, 2026
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.
Problem
AddSettingsPluginRepository(Fix duplicate gradlePluginPortal() in settings.gradle.kts #7230) matches on method name only. This incorrectly prevents adding a secondmaven {}orivy {}repository with a different URL, since both share the same method name.Solution
Gate the name-based check on
url == nullso it only applies to repositories uniquely identified by name (gradlePluginPortal,mavenCentral,mavenLocal,google). URL-based repositories likemaven {}andivy {}skip the fallback and rely onFindRepositoryfor duplicate detection.