Skip to content

Limit name-based repo duplicate check to URL-less repositories#7245

Merged
pstreef merged 2 commits intomainfrom
fix/name-fallback-url-repos
Apr 2, 2026
Merged

Limit name-based repo duplicate check to URL-less repositories#7245
pstreef merged 2 commits intomainfrom
fix/name-fallback-url-repos

Conversation

@pstreef
Copy link
Copy Markdown
Contributor

@pstreef pstreef commented Apr 2, 2026

Problem

Solution

Gate the name-based check on url == null so it only applies to repositories uniquely identified by name (gradlePluginPortal, mavenCentral, mavenLocal, google). URL-based repositories like maven {} and ivy {} skip the fallback and rely on FindRepository for duplicate detection.

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`.
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Apr 2, 2026
@pstreef pstreef marked this pull request as ready for review April 2, 2026 12:10
@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Apr 2, 2026
@pstreef pstreef merged commit 363f555 into main Apr 2, 2026
1 check passed
@pstreef pstreef deleted the fix/name-fallback-url-repos branch April 2, 2026 12:30
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants