You are reading documentation for 0.6.0. The latest release in the 0.6 line is 0.6.1.

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

This release fixes config-file values that action defaults silently overrode, makes periodic GC more conservative after failed Gradle builds, and lets a distributed aggregator proceed when a dependent job uploaded no artifact. Highlights Config-file values now apply to every input. Previously, an input with a default in action.yml ignored its config-file value, because GitHub passes metadata defaults to the action as if the workflow had set them. This affected, for example, job-mode, cache-key-prefix, cleanup-enabled, cache-gc-mode and cache-gc-older-than-days. Defaults now apply after config-file resolution: direct inputs win, then config-file values, then defaults. The input descriptions state each default. A Gradle worker whose build failed, or started but recorded no result, no longer counts towards full sweep coverage. Such a build may have used only part of its dependencies, for example after failing to resolve settings plugins, and a sweep could evict entries that later builds download again. The worker still publishes its changes. The sweep waits for a run in which every listed worker succeeds, or for the forced sweep after dependency-gc-force-grace-days. The Gradle build summary lists builds that started but recorded no result. Such builds failed before settings evaluation or were interrupted, and previously did not appear in the summary at all. Add allow-missing-dependent-jobs, enabled by default. When a job in dependent-jobs uploaded no artifact, for example because it was skipped, failed before the Mammoth step, or was cancelled before its post step, the aggregator warns and merges the available workers. Previously the whole aggregation failed, discarding every other worker’s changes. A missing job still prevents full sweep coverage, and snapshot partitions of a missing writer keep the previous snapshot. Upgrade notes Cache formats are unchanged, and existing 0.5.x generations can be reused. Workers and aggregators of 0.5.x and 0.6.0 can be mixed: a worker that withholds sweep evidence writes the ordinary worker identity that 0.5.x aggregators accept. Review your config files. Values that were previously overridden by action defaults now take effect. Workflows that repeated such values as direct inputs to work around the problem can drop them. Aggregators no longer fail when a listed job uploaded no artifact. Set allow-missing-dependent-jobs: false to keep the previous failure, for example to detect a misspelled job name or a missing needs entry early. List every worker in dependent-jobs, including conditional ones. A list shortened to the workers that ran also shortens the coverage requirement and lets a sweep evict entries that only the omitted workers use. A Gradle build that is expected to fail, for example one launched by an Exec task, now defers sweeps for its worker. Set BUILDISH_MAMMOTH_CACHE_GRADLE_SKIP_BUILD_RESULT_CAPTURE=true in that build’s environment to exclude it. Builds launched by Test tasks are already excluded. With dependency-gc-force-grace-days: off, a worker that fails in every run prevents sweeps. Standalone jobs and Maven workers are unchanged: their sweep decisions do not depend on build outcomes. Review v0.6.0-rc1 as the first release candidate and use v0.6.0 after final promotion.