The latest stable release is 0.8.4.

Buildish Mammoth Cache for Gradle and Maven

Documentation for Buildish Mammoth Cache for Gradle and Maven — CI actions that cache the build tool’s local artifact store across workflow runs.

Buildish Mammoth Cache for Gradle and Maven is a pair of CI actions that cache the build tool’s local artifact store across workflow runs:

  • Gradle — caches GRADLE_USER_HOME and provisions Gradle wrapper JARs securely before the build starts.
  • Maven — caches the Maven local repository (~/.m2 by default).

Both actions share the same two-phase prepare/finalize lifecycle and support single-job and distributed multi-job topologies.

For Gradle, Mammoth also preserves entries from Gradle’s local build cache, allowing Gradle to reuse task outputs. For Maven, Mammoth caches repository artifacts; build-output caching requires a separately configured extension.

Use Adoption and Migration to choose a topology, understand costs and plan a small pilot, then follow Getting Started for workflow wiring.

Single-job mode

In the most common setup, the action wraps a single build job: it restores the newest compatible immutable generation before the build and publishes a new complete generation after a material change. This avoids re-downloading dependencies on every run without creating duplicate entries for unchanged runs.

Distributed multi-job mode

When a workflow runs multiple build jobs in parallel — for example, one job per subproject or one job per test suite — independent full-cache generations diverge. Restoring only the newest generation then loses the dependency downloads that exist solely in the other workers’ generations.

This action solves that with a delta exchange model:

  • Each worker job computes only the difference between what was in the cache when it started and what is in the cache after the build. It uploads that delta as a workflow artifact.
  • A dedicated aggregator job, which runs after all workers complete, downloads every delta, merges them, and saves the merged result as the new base cache entry.

Aggregate partitions combine workers’ contributions subject to conflict policies; single-writer metadata partitions retain their designated writer’s view. See Adoption and Migration for the coverage tradeoffs.

graph LR
    BC["Base cache\n(previous run)"] --> W1 & W2 & W3
    W1["Worker A\nbuild + delta"] -- "Δ artifact A" --> AGG
    W2["Worker B\nbuild + delta"] -- "Δ artifact B" --> AGG
    W3["Worker C\nbuild + delta"] -- "Δ artifact C" --> AGG
    AGG["Aggregator\nmerge + save"] --> BC2["Base cache\n(this run)"]

Licensing and maintenance independence

Mammoth’s own code is Apache-2.0 licensed. The same license covers its cache orchestration in public and private repositories, including commercial builds. You can inspect and modify the implementation, maintain a fork, and redistribute it subject to the license conditions, including applicable license, notice and change-marking requirements. Using the caching implementation requires no separate Mammoth caching subscription.

Bundled dependencies retain their own licenses and attribution requirements; consult the distribution license inventory and notices for the version you use. GitHub cache/artifact services keep their own terms, limits and charges. Downloaded JDKs, Gradle/Maven distributions and separately used build services also retain their applicable terms.

When choosing a cache implementation, consider the rights to inspect, fix and maintain it, any separate provider agreements, and the effort required to migrate if its availability, terms or pricing change. Evaluate feature coverage and measured performance separately; an open-source license alone does not establish either.


User Guide

How to use Buildish Mammoth Cache for Gradle and Maven in your workflows.

Architecture & Background

Design documents covering the internal architecture of Buildish Mammoth Cache for Gradle and Maven.

Developer Guide

Architecture, portability, and release information for contributors to Buildish Mammoth Cache for Gradle and Maven.

Threat Model

Threat model for Buildish Mammoth Cache for Gradle and Maven.

Release Notes for 0.2.2

This release reduces repeated filesystem, hashing and metadata-validation work during cache restore, distributed worker application and publication. It keeps the existing cache formats and Node.js 24 action runtime. Actual performance gains depend on the cache layout and runner; no hosted elapsed-time speedup is claimed. Highlights Stop rehashing base-cache payloads during restore, including single-writer snapshot initialization. Continue checking generation/object identity, descriptor digests, path ownership, file membership, regular-file types and sizes. Base payload bytes are trusted to authorized producers and the cache service; same-size corruption of those bytes is no longer detected by Mammoth during restore. Build and index installation metadata once per stable phase. Share ancestor checks, move complete base workspaces where possible, avoid unnecessary permission and timestamp updates, and retain guarded installation and recovery handling. Consume disposable worker payloads with guarded moves where possible, with cross-filesystem copy fallback. Preserve worker payload verification and coherent whole-workspace selection; live cache files are not moved into worker uploads. Keep whole-cache publication inventories bounded independently of the number of saved partitions. Check the relevant partition’s sources around each upload and retain a final complete replay and directory-topology barrier before publishing the generation record. Hash newly captured ordinary publication payloads once per finalize invocation. Reuse snapshot capture/verification digests only while their source identities remain valid. Retries rebuild local evidence and verify previously receipted objects by exact readback before reusing them. Pass validated partition descriptors forward, reuse validation of owned immutable publication plans, and share source-directory checks within stable operations. Preserve durable receipt checkpoints and record-last publication. Add publication work counters and timings for inventories, hashing, checkpoints and backend saves. Keep generated Gradle build-reporting runtime checks compatible with Node.js 24. Upgrading from 0.2.1 No action-input or workflow changes are required. Cache schemas, storage families, worker-package formats and generation records are unchanged; existing 0.2.1 caches remain eligible for reuse. Upgrading does not itself force a cold cache. Review the base-restore trust change above. Worker imports still verify payload content, and store/publication retains content hashing with operation-local identity-bound reuse. The Gradle and Maven actions continue to use Node.js 24. Publication requires stable source trees. Creating or removing even an excluded sibling can conservatively invalidate its parent’s directory evidence and reject publication. Keep build processes from changing managed cache trees during post. Remaining capacity limits Metadata record/byte limits and worker-package size limits are unchanged. Large retained caches or substantial dependency/Gradle-version churn can still exceed those limits during aggregation or other lifecycle stages. These optimizations do not resolve that capacity issue or establish support for larger cache inventories. Changed partitions continue to upload in full; unchanged partitions are reused.