Skip to content

CI: download Maven artifacts from Google's mirror and cache them - #9640

Merged
kroening merged 1 commit into
diffblue:developfrom
tautschnig:maven-central-mirror
Dec 4, 2026
Merged

kroening merged 1 commit into
diffblue:developfrom
tautschnig:maven-central-mirror

Conversation

@tautschnig

Copy link
Copy Markdown
Collaborator

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.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

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 tautschnig added the CI label Dec 4, 2026
Copilot AI balanced review requested due to automatic review settings December 4, 2026 09:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

codecov Bot commented Dec 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.34%. Comparing base (aef1c2b) to head (2de03aa).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kroening
kroening merged commit 7401805 into diffblue:develop Dec 4, 2026
39 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants