Repository navigation
ci: resolve Gradle dependencies through the runners' Maven mirror - #36
Merged
Merged
Conversation
Maven Central answers hbr1's IP with 429 and fails builds at plugin resolution. The self-hosted runners now advertise a pull-through mirror in MAVEN_MIRROR_URL. A new maven-mirror composite action probes that mirror and, when it answers, installs a Gradle init script that points Maven Central, the Gradle Plugin Portal and PaperMC at it. Without the variable (hosted runners) or with the mirror down, it warns and changes nothing. gradle-ci, gradle-publish and docker-gradle-build-push run it before Gradle. The Docker workflow also passes the script to the image builds as the BuildKit secret gradle_init, which Dockerfiles opt in to with a secret mount on their Gradle RUN.
The pilot ran the action from the feat/maven-mirror branch. Point the reusable workflows at main, the same way they pin update-openapi-snapshot, so the action resolves once this lands.
This was referenced Oct 17, 2026
fix(build): resolve dependencies through the runner mirror in Docker builds
groundsgg/buildsystem#39
Merged
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.
Pull Request
Description
Maven Central answers hbr1's IP with 429, so builds on the self-hosted runners fail at plugin resolution (
Could not GET https://repo.maven.apache.org/.../kotlin-stdlib-2.2.20.pom ... 429). The runner pods now setMAVEN_MIRROR_URLto a Reposilite pull-through cache in the runners' cluster, with three repos:/releases,/gradle-pluginsand/papermc..github/actions/maven-mirror. IfMAVEN_MIRROR_URLis set and a 3 s probe of$URL/releases/org/jetbrains/kotlin/kotlin-stdlib/maven-metadata.xmlreturns 200, it installs~/.gradle/init.d/grounds-maven-mirror.init.gradle.ktsand outputs its path asinit-script. Otherwise it writes a::warning::and changes nothing, so hosted runners, or a run while the mirror is down, behave as before.mavenCentral(), repo.maven.apache.org, repo1.maven.org) goes to/releases, repo.papermc.io/repository/maven-public to/papermc, andgradlePluginPortal()is replaced by a plainmaven { }pointing at/gradle-plugins. Only those repos getisAllowInsecureProtocol, because the mirror is plain HTTP inside the cluster. GitHub Packages,mavenLocal()and every other repo are left alone.buildscript,pluginManagementanddependencyResolutionManagementrepositories, plus every project'sbuildscriptandrepositories.pluginManagementrepositories, Gradle normally falls back to an implicit plugin portal. The script declares that portal explicitly so it also goes through the mirror.Using Maven mirror <url>.gradle-ci.ymlandgradle-publish.ymlrun the action right after "Set up Gradle".docker-gradle-build-push.ymlruns it before./gradlew -q properties. Both build-push steps pass the script as the BuildKit secretgradle_init, and only when the action produced it. A Dockerfile opts in with one line on its GradleRUN:required=false, local builds and builds on hosted runners still work.The workflows reference the action at
@main, so it only resolves once this PR is merged. The pilot ran against@feat/maven-mirror(first commit).Type of Change
Related Issues
Testing
tests/test_docker_workflow.py)Local, Gradle 9.2.1, run against the mirror with
--refresh-dependencies --info:/gradle-plugins.mavenCentral()resolved through/releases, and paper-api through/papermc.buildSrcwithkotlin-dsland nopluginManagementblock went through the mirror via the implicit portal.Pilot in game-survivalgames#11 on
grounds-runners. Both runs passed:Using Maven mirror http://maven-mirror.arc-runners.svc.cluster.local:8080in the action and in both Gradle invocations.RUNlogged#15 44.76 Using Maven mirror http://maven-mirror.arc-runners.svc.cluster.local:8080, thenBUILD SUCCESSFUL. Its caches were cold (it downloaded the Gradle distribution), so the cluster DNS name resolves inside BuildKitRUNsteps under DinD with the docker-container driver. No ClusterIP workaround is needed.Checklist