Skip to content

CI: keep the Maven cache warm so builds stop re-downloading Central - #67

Merged
martypitt merged 1 commit into
mainfrom
ci-maven-caching
Aug 7, 2026
Merged

CI: keep the Maven cache warm so builds stop re-downloading Central#67
martypitt merged 1 commit into
mainfrom
ci-maven-caching

Conversation

@martypitt

Copy link
Copy Markdown
Contributor

Problem

Nearly every CI run spends minutes re-downloading the full dependency tree from Maven Central, despite cache configuration being present.

Root cause: GitHub evicts any Actions cache not accessed for 7 days, and this repo regularly goes quiet for longer than that — the repo currently has zero stored caches. Every build therefore starts cold. There was also redundant double-caching: setup-java with cache: maven already caches ~/.m2/repository, but a second actions/cache step cached all of ~/.m2 on top of it.

Changes

  • New warm-maven-cache.yml: a twice-weekly (Mon + Thu) scheduled job running mvn dependency:go-offline with the same cache config. On a hit it's a cheap no-op that resets the 7-day eviction clock; when poms change it rebuilds the cache. Real builds then restore a warm cache instead of downloading from Central.
  • build.yml: dropped the redundant actions/cache step; added -Dmaven.artifact.threads=16 (default 5) so cold downloads run faster, and -B -ntp to reduce log noise; added workflow_dispatch so a build (and :next image publish, when run on main) can be kicked manually.

Caveat

GitHub auto-disables scheduled workflows after 60 days without repo activity — if the repo has been dormant that long, re-enable the warmer from the Actions tab (noted in a comment in the workflow).

🤖 Generated with Claude Code

The repo often goes quiet for longer than the 7-day Actions cache
eviction window, so every build started cold and re-downloaded the full
dependency tree. Add a twice-weekly cache-warmer job to keep the cache
alive, drop the redundant second cache step (setup-java's cache:maven
already covers ~/.m2/repository), parallelise artifact downloads for
the cold case, and allow manual builds via workflow_dispatch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@netlify

netlify Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deploy Preview for orbital-nebula canceled.

Name Link
🔨 Latest commit b6e1781
🔍 Latest deploy log https://app.netlify.com/projects/orbital-nebula/deploys/6a756b25b4f08100085f1c94

@martypitt
martypitt merged commit b7401d9 into main Aug 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant