From 73bc1ef751bd2a8f638cddfae3a3819242e97038 Mon Sep 17 00:00:00 2001 From: Zhe Sun Date: Wed, 2 Dec 2026 13:42:26 +0200 Subject: [PATCH] ci: fall back to Maven Central when the mirror lacks an artifact Google's mirror of Maven Central syncs with a delay, so an artifact released minutes ago is not there yet. With the mirror configured as a of central, Maven never asked Central itself and the build failed. Add the mirror as a repository in an active settings profile instead, so it is tried first and Maven falls back to the pom repositories and to Central on a 404. Co-Authored-By: Claude Opus 5.5 --- .github/maven/settings.xml | 64 +++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/.github/maven/settings.xml b/.github/maven/settings.xml index 923ec93324d..862304577d3 100644 --- a/.github/maven/settings.xml +++ b/.github/maven/settings.xml @@ -5,12 +5,18 @@ Central rate-limits by client IP, and GitHub-hosted runners share their IP ranges with every other project on GitHub, so a validation run's parallel - jobs get 429 answers from repo.maven.apache.org. Central is read through - Google's mirror of it instead, which serves the same artifacts without - that limit. The mirror keeps the id central so that the - _remote.repositories records in the cached ~/.m2/repository still name the - repository a build resolves through; under another id Maven would no - longer trust the cached copies and download them again. + jobs get 429 answers from repo.maven.apache.org. Artifacts are therefore + read from Google's mirror of Central first, which serves the same + artifacts without that limit. The mirror is added as a repository rather + than a of central: a mirror replaces Central, and Google syncs + from Central with a delay, so an artifact that was released minutes ago is + missing there and the build fails. As a repository in an active settings + profile it is tried before the repositories of the poms, and Maven falls + back to them and to Central itself (always last) when the mirror answers + 404. Only artifacts the mirror does not have yet are then downloaded from + Central. Artifacts in the cached ~/.m2/repository that were downloaded + under the id central stay valid, because central is still one of the + repositories. Some JBoss parent poms the wildfly-maven-plugin pulls in declare the public groups on repository.jboss.org and list them ahead of Maven Central for a @@ -18,23 +24,51 @@ through the resolver's retries before falling back to Central, which costs the JBoss EAP dev loop job 7 to 11 minutes of its test budget. Everything the build resolves through them is also on Central, so they are read from - the same Central mirror instead. A mirror matches repository ids, not - hosts: the list holds every id the build's dependency poms give those - groups under. --> + the Central mirror instead. A mirror matches repository ids, not hosts: + the list holds every id the build's dependency poms give those groups + under. --> - - central - Google Cloud Storage mirror of Maven Central - central - https://maven-central.storage-download.googleapis.com/maven2/ - jboss-public-via-central jboss-public-repository-group,jboss-public-repository,jboss,JBoss-Archive,nexus,public-jboss,public-jboss-plugins https://maven-central.storage-download.googleapis.com/maven2/ + + + google-mirror-first + + + google-maven-central + Google Cloud Storage mirror of Maven Central + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + + google-maven-central + Google Cloud Storage mirror of Maven Central + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + + + + + + + google-mirror-first +