Repository navigation
CI: download Maven artifacts from Google's mirror and cache them - #9640
Merged
Merged
Conversation
Jobs that build JBMC failed at random because Maven Central answered with HTTP 429 (Too Many Requests): 13 of the 100 jobs that failed on 2 and 3 December 2026 failed this way, 10 of them during a single burst of pushes and 3 on develop. Maven Central limits the downloads per IP address, and GitHub-hosted runners share their addresses with the jobs of other users. Each of our jobs started from an empty local repository and downloaded about 720 files (170 MB) to build the Java models library and the classes of the JBMC regression tests. Sonatype, which runs Maven Central, advises against retrying, as continued requests extend the block. The new setup-maven action makes Maven download from Google's mirror of Maven Central, which Maven Central itself lists as a mirror, and caches ~/.m2/repository, keyed on the Maven version and the POM files. The mirror is the first repository of an active profile in settings.xml rather than a <mirror>, so that Maven still falls back to Maven Central for what the mirror does not have or cannot serve. Starting from an empty local repository, both Maven builds succeed with Maven 3.6.3 (as on Ubuntu 22.04), 3.8.7 (Ubuntu 24.04) and 3.9.12, and download 715 to 718 files from the mirror, 2 from jitpack.io, and none from Maven Central. When the mirror answers 404 or refuses connections, Maven takes the artifact from Maven Central within seconds. A mirror that accepts connections but does not answer would stall each download until Maven's read timeout, as it would with a <mirror>. With the local repository restored, nothing is downloaded. All jobs that run Maven use the action. The BSD jobs do not build JBMC, and the Docker image build runs Maven inside BuildKit, where ~/.m2/settings.xml does not apply; both are unchanged. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
tautschnig
requested review from
a team,
kroening and
peterschrammel
as code owners
December 4, 2026 09:34
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the Maven mirror and artifact-caching changes.
No open issues 🎉
What changed in this PR
Reduces Maven Central rate-limit failures in JBMC CI builds by preferring Google’s mirror and caching downloaded artifacts.
Changes:
- Adds a cross-platform Maven setup action with caching keyed by operating system, Maven version, and POM files.
- Configures Google’s mirror with Maven Central as fallback.
- Integrates the action into Maven-running workflows and documents its use.
| File | Description |
|---|---|
.github/workflows/release-packages.yaml |
Adds Maven setup to release builds. |
.github/workflows/README.md |
Documents Maven download configuration and usage. |
.github/workflows/pull-request-checks.yaml |
Adds Maven setup across platform checks. |
.github/workflows/coverage.yaml |
Adds Maven setup to coverage builds. |
.github/workflows/codeql-analysis.yml |
Adds Maven setup to CodeQL builds. |
.github/actions/setup-maven/settings.xml |
Configures preferred artifact and plugin repositories. |
.github/actions/setup-maven/action.yaml |
Installs settings and caches the local Maven repository. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #9640 +/- ##
========================================
Coverage 81.34% 81.34%
========================================
Files 1727 1727
Lines 191752 191752
Branches 73 73
========================================
Hits 155988 155988
Misses 35764 35764 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kroening
approved these changes
Dec 4, 2026
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.
Jobs that build JBMC failed at random because Maven Central answered with HTTP 429 (Too Many Requests): 13 of the 100 jobs that failed on 2 and 3 December 2026 failed this way, 10 of them during a single burst of pushes and 3 on develop. Maven Central limits the downloads per IP address, and GitHub-hosted runners share their addresses with the jobs of other users. Each of our jobs started from an empty local repository and downloaded about 720 files (170 MB) to build the Java models library and the classes of the JBMC regression tests. Sonatype, which runs Maven Central, advises against retrying, as continued requests extend the block.
The new setup-maven action makes Maven download from Google's mirror of Maven Central, which Maven Central itself lists as a mirror, and caches ~/.m2/repository, keyed on the Maven version and the POM files. The mirror is the first repository of an active profile in settings.xml rather than a , so that Maven still falls back to Maven Central for what the mirror does not have or cannot serve.
Starting from an empty local repository, both Maven builds succeed with Maven 3.6.3 (as on Ubuntu 22.04), 3.8.7 (Ubuntu 24.04) and 3.9.12, and download 715 to 718 files from the mirror, 2 from jitpack.io, and none from Maven Central. When the mirror answers 404 or refuses connections, Maven takes the artifact from Maven Central within seconds. A mirror that accepts connections but does not answer would stall each download until Maven's read timeout, as it would with a . With the local repository restored, nothing is downloaded.
All jobs that run Maven use the action. The BSD jobs do not build JBMC, and the Docker image build runs Maven inside BuildKit, where ~/.m2/settings.xml does not apply; both are unchanged.