Repository navigation
Wrap Maven Central to the cache redirector #5757
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
Vladimir Mazunin (mazunin-v-jb)
merged 4 commits into
master
from
v.mazunin/429-error-teamcity
Oct 15, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d6d63df
Re-enable Kotlin Toolchain in CodeViewer and update build scripts to …
mazunin-v-jb 7b4842e
Review fixes: renamed central to MavenCentralCacheRedirector
mazunin-v-jb 356a259
Review fixes: Moved cache-redirector init script to `ci` directory, r…
mazunin-v-jb f86fb6c
Route Maven Central through JetBrains cache-redirector in `ci/build-h…
mazunin-v-jb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,10 @@ | ||
| pluginManagement { | ||
| repositories { | ||
| mavenCentral { | ||
| url = uri("https://cache-redirector.jetbrains.com/maven-central") | ||
| } | ||
| gradlePluginPortal() | ||
| } | ||
| } | ||
|
|
||
| include(":publishing") |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Resolves Maven Central artifacts through JetBrains cache-redirector, to avoid hitting Maven Central rate limits (HTTP 429) on CI. | ||
| // Used by Gradle plugin tests (TestProject.kt) and examples/validateExamples*.sh, the projects themselves don't depend on it. | ||
| // The redirector has to go before Gradle Plugin Portal, as the portal redirects such artifacts to Maven Central. | ||
|
|
||
| def redirectorName = "MavenCentralCacheRedirector" | ||
| def redirectorUrl = "https://cache-redirector.jetbrains.com/maven-central" | ||
|
|
||
| beforeSettings { settings -> | ||
| // Repositories declared in settings scripts are added after this one | ||
| settings.pluginManagement.repositories.maven { | ||
| name = redirectorName | ||
| url = redirectorUrl | ||
| } | ||
| settings.dependencyResolutionManagement.repositories.maven { | ||
| name = redirectorName | ||
| url = redirectorUrl | ||
| } | ||
| } | ||
|
|
||
| settingsEvaluated { settings -> | ||
| // Direct Maven Central is replaced by the redirector above: | ||
| // on 429 it fails the resolution instead of falling through to the next repositories (e.g. mavenLocal with snapshots) | ||
| [settings.pluginManagement.repositories, settings.dependencyResolutionManagement.repositories].each { repositories -> | ||
| repositories.removeAll { it instanceof MavenArtifactRepository && it.url.host == "repo.maven.apache.org" } | ||
|
|
||
| // Gradle Plugin Portal redirects artifacts it doesn't host (e.g. AGP from Google Maven) to Maven Central, | ||
| // so it goes last for other repositories to be checked first | ||
| def pluginPortals = repositories.findAll { it instanceof MavenArtifactRepository && it.url.host == "plugins.gradle.org" } | ||
| repositories.removeAll(pluginPortals) | ||
| pluginPortals.each { repositories.addLast(it) } | ||
| } | ||
| } | ||
|
|
||
| allprojects { | ||
| // Some projects declare repositories in build scripts, there direct Maven Central is redirected in place | ||
| repositories.configureEach { repository -> | ||
| if (repository instanceof MavenArtifactRepository && repository.url.host == "repo.maven.apache.org") { | ||
| repository.url = redirectorUrl | ||
| } | ||
| } | ||
| } |
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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,11 @@ | ||
| pluginManagement { | ||
| repositories { | ||
| mavenCentral { | ||
| url = uri("https://cache-redirector.jetbrains.com/maven-central") | ||
| } | ||
| gradlePluginPortal() | ||
| } | ||
| } | ||
|
|
||
| rootProject.name = "compose-uber-jar" | ||
|
|
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 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 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 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 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 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 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 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| pluginManagement { | ||
| repositories { | ||
| mavenCentral { | ||
| url = uri("https://cache-redirector.jetbrains.com/maven-central") | ||
| } | ||
| gradlePluginPortal() | ||
| } | ||
| } |
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 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 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 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 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 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| pluginManagement { | ||
| repositories { | ||
| mavenCentral { | ||
| url = uri("https://cache-redirector.jetbrains.com/maven-central") | ||
| } | ||
| gradlePluginPortal() | ||
| } | ||
| } |
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 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 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 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 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reuse a single copy somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symbolic link should work fine on macOS and Linux, and there should be some setting to make it work on Windows too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep - JetBrains/compose-multiplatform-core#2747
But It's probably out of scope here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've decided to use a single copy of that script without symlinks just in case