Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 49 additions & 15 deletions .github/maven/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,70 @@

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 <mirror> 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
few BOMs. When that host is slow or answers 503, every such artifact waits
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. -->
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<mirrors>
<mirror>
<id>central</id>
<name>Google Cloud Storage mirror of Maven Central</name>
<mirrorOf>central</mirrorOf>
<url>https://maven-central.storage-download.googleapis.com/maven2/</url>
</mirror>
<mirror>
<id>jboss-public-via-central</id>
<mirrorOf>jboss-public-repository-group,jboss-public-repository,jboss,JBoss-Archive,nexus,public-jboss,public-jboss-plugins</mirrorOf>
<url>https://maven-central.storage-download.googleapis.com/maven2/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>google-mirror-first</id>
<repositories>
<repository>
<id>google-maven-central</id>
<name>Google Cloud Storage mirror of Maven Central</name>
<url>https://maven-central.storage-download.googleapis.com/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>google-maven-central</id>
<name>Google Cloud Storage mirror of Maven Central</name>
<url>https://maven-central.storage-download.googleapis.com/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>google-mirror-first</activeProfile>
</activeProfiles>
</settings>