User Guide
How to use Buildish Mammoth Cache for Gradle and Maven in your workflows.
The latest stable release is 0.8.4.
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_USER_HOME and provisions Gradle wrapper JARs securely before the
build starts.~/.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.
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.
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:
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)"]
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.
How to use Buildish Mammoth Cache for Gradle and Maven in your workflows.
Design documents covering the internal architecture of Buildish Mammoth Cache for Gradle and Maven.
Architecture, portability, and release information for contributors to Buildish Mammoth Cache for Gradle and Maven.
Threat model for Buildish Mammoth Cache for Gradle and Maven.
This release replaces the flat journal-based cache lifecycle with hierarchical streaming and bounded per-directory processing. It reduces repeated local observation, validation and metadata work while retaining exact reuse of unchanged cache objects. The cache formats are incompatible with 0.2.x: expect cold caches and upgrade cooperating distributed jobs together. The Actions continue to run on Node.js 24. Highlights Use versioned native partition objects, generation records, local handoffs and worker TAR streams. Publish changed objects before their immutable generation record, and reuse exact object references for unchanged partitions. Changed partitions still upload in full. Replace whole-cache journal inventories with hierarchical streaming and bounded directory processing. Reuse operation-local indices and validated evidence, reduce repeated metadata decoding and scratch reads, and skip GC replay when a sealed capture establishes that there are no deletion targets. These are reductions in work; elapsed-time gains depend on cache layout, payloads, runner and backend. Preserve complete Gradle Groovy, Kotlin DSL and transform workspaces, while using per-entry selection for eligible task-output cache archives. Keep authoritative dependency-metadata snapshots separate from aggregate worker contributions. Use guarded native moves for publication and return writable source trees within the same operation after SDK consumers settle. Interrupted owners are rejected; the lifecycle does not provide restart/replay recovery or ambiguous-upload salvage. Failed worker uploads can retain immutable packages at reported paths. Expose cache-max-directory-entries on both Actions. The default is 100000 direct entries per managed directory, independently of working-memory budgets. Diagnostics identify the affected phase, directory and limit. Retain strict incoming worker body and complete-unit validation. Preserve owned empty descendants of selected complete units and retire local metadata readers before their scratch storage closes. Rename verified Gradle wrapper metadata to gradle-wrapper-<version>.jar.sha256 and gradle-wrapper-<version>.jar.asc, allowing custom launchers to retain Mammoth’s verified wrapper JAR. Upgrading from 0.2.2 Expect a cold cache. The new namespace and worker/native/generation/local formats do not reuse the old cache families. Upgrade all cooperating workers, aggregators and readers together, using consistent partition and writer settings. There is no old-format bridge or permanent dual-format path. Review the Gradle dependency-metadata writer configuration. Its complete snapshot must cover the dependency sets needed by downstream offline consumers; aggregating artifact files alone does not make an incomplete metadata snapshot sufficient. Use dedicated cache roots and an exclusive prepare/post window. Keep other cache actions and concurrent consumers from modifying the same managed trees. Gradle writable publication requires consumer quiescence. Preserve reported interrupted or retained state for diagnosis rather than expecting automatic restart recovery. Base change detection uses filesystem metadata. Byte rewrites that preserve the observed metadata may be missed; Mammoth does not maintain a per-file base content catalogue. Native base bytes rely on authorized producers and the cache service; incoming worker payload validation remains strict. Scripts that consume gradle-wrapper-<version>.sha256 or gradle-wrapper-<version>.asc must use the new .jar.sha256 and .jar.asc names. Provisioning no longer writes the previous names; existing files are left in place. Review unusually wide managed directories before raising the new directory-entry limit. A larger limit is not a guarantee of sufficient runner memory or disk. Review the exact v0.3.0-rc1 candidate tag and use v0.3.0 after final promotion, at actions/github/gradle or actions/github/maven. Ordinary source branches omit the generated executable bundles; use a materialized release or candidate ref.