Skip to content

Cache Maven distribution and dependencies in CI - #2335

Merged
hyperxpro merged 1 commit into
mainfrom
actions-caching
Sep 20, 2026
Merged

hyperxpro merged 1 commit into
mainfrom
actions-caching

Conversation

@hyperxpro

Copy link
Copy Markdown
Member

Motivation:

Nothing in CI was cached. Every job re-downloaded the wrapper's Maven distribution and the whole local repository on each run, which made builds slow and turned the Maven download into a frequent point of failure.

Modification:

Enable setup-java's Maven cache, which keeps the wrapper distribution under a key that only rotates when the pinned Maven version changes, so dependency bumps no longer evict it. Pull requests read the caches without writing branch-scoped copies.

Add a prefetch-maven composite action that retries the remaining cold fetch, and drop the chmod +x ./mvnw steps since mvnw is already executable in git.

Result:

Maven and its dependencies come from cache, and a transient download failure retries instead of taking the job down.

@hyperxpro
hyperxpro merged commit 1506e46 into main Sep 20, 2026
31 checks passed
@hyperxpro
hyperxpro deleted the actions-caching branch September 20, 2026 15:00
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