You are reading documentation for 0.2.0. The latest release in the 0.2 line is 0.2.2.

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.0

This minor release improves Gradle and Maven cache coverage, distributed recovery, and publication efficiency. It changes cache identities and worker transport; upgrading starts a cold cache family. Highlights Save changed partitions independently and reuse unchanged partition objects. Publish the generation record only after required objects are available. Missing objects recover as cold partitions while unrelated valid partitions remain usable; connected Maven directory owners recover together. Changed partitions still upload in full. Native archives and move-based restores avoid additional base payload copies on the normal path. Replace before/after full-content inventories with post-prepare timestamp cutoffs. Freeze writable activity decisions before Mammoth reads payloads. Read-only finalize skips publication-oriented scans, snapshot capture, GC and saves; restore integrity checks still apply. Cache Gradle dependency metadata through a default dependency-metadata single-writer partition. Standalone jobs own their snapshots automatically; distributed jobs can designate an existing worker or the aggregator as writer. Complete snapshots propagate removals without merging Gradle’s binary indexes. Add a default groovy-dsl partition that preserves complete compiled-script workspaces, both metadata files and empty output directories. Conflicting views select one producer’s complete workspace. Existing Kotlin DSL coverage remains. Share cache families across Java versions, operating systems and architectures by default. Build tools and project inputs determine output reuse. Cross-OS archives preserve portable paths and repair known distribution launchers on POSIX. Preserve Maven _remote.repositories origin markers and complete managed directory views. Strict conflicts remain the default. The optional partition policy conflict-handling: choose-worker-directory selects a complete worker directory when independent contributions conflict. Retain worker envelopes after successful and failed aggregation, allowing selective and aggregator-only retries within artifact availability. New input worker-artifact-retention-days requests 7 days by default and accepts whole days from 1–400, subject to backend and organization limits. Shorter retention narrows the retry window; successful aggregation does not delete the envelopes. Write verified Gradle wrapper metadata beside the versioned JAR as gradle-wrapper-<version>.jar.sha256 and .jar.asc, so compatible custom launchers can retain the provisioned JAR. Add an adoption and migration guide covering topology, ownership, write policy, remaining costs, Maven scope, and small pilots with rollback. Extend hosted CI with Linux, Windows and macOS ARM64 workers, Linux aggregation, fresh native readers, and Java 21/25 sharing checks for Gradle and Maven. Upgrading from 0.1.x Upgrade cooperating workers and aggregators together. Old cache families start cold, and older worker envelopes are not compatible with the new transport. Start a new workflow run when changing versions rather than combining retained envelopes from different implementations. Review namespaces and writer policy. Java, OS and architecture no longer create separate families automatically; use cache-key-prefix when isolation is needed. Independent standalone writers publish their own views, not a merged union. For distributed Gradle jobs, configure the same dependency-metadata writer and partition settings on all participants. Without a writer, the previous metadata snapshot is retained with a warning. A writer’s snapshot covers its own resolution view, not every worker’s metadata. Managed snapshot files are replaced during prepare, including clearing them on a miss, even when ordinary restore cleanup is disabled. Start with a fresh dedicated Maven user home when upgrading from the previous marker-excluding policy. Keep repository/mirror configuration compatible. Maven snapshots and local installs remain included by default; exclude complete coordinate/version directories when appropriate and retain separate delivery of required build artifacts. Directory-winner selection can discard losing classifiers, origin entries or local installs; enable it deliberately. Update scripts that consume the old wrapper sidecar names gradle-wrapper-<version>.sha256 or .asc. Provisioning writes the new .jar.sha256 and .jar.asc names; existing old sidecars are left untouched. Timestamp GC now uses file age plus current-build activity protection, not a historical last-use manifest. Hidden filesystem accesses or clock behavior can cause useful files to be evicted and downloaded or recomputed later. cache-gc-mode: off disables deletion, not tracking or snapshot work. The Gradle and Maven actions continue to use the Node.js 24 runtime. Review the exact v0.2.0-rc1 candidate tag and use v0.2.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.