The latest stable release is 0.8.4.
Maven Cache Internals
The Maven local repository stores downloaded artifacts, locally installed builds, and Resolver
metadata. Mammoth preserves that distinction when caching repository/ under the Maven user home.
Coordinates identify paths, not content
The usual layout is:
1repository/<groupId path>/<artifactId>/<version>/<artifactId>-<version>.<ext>
These paths are coordinate-addressed, not content-addressed. Snapshots, local installs, and repositories serving different bytes for identical coordinates can overwrite the same path. Neither the path nor Mammoth’s cache family authenticates an artifact.
The default repository partition includes releases, snapshots, plugins, local installs, Maven
metadata, and origin markers. Existing partition exclusions can remove complete coordinate trees;
see Maven caching patterns.
Origin markers: _remote.repositories
Resolver’s enhanced local repository manager writes a properties file beside the artifacts:
1example-1.0.jar>central=
2example-1.0.pom>central=
3example-1.0-tests.jar>=
The key combines a filename with a repository key. An empty repository key identifies a local install. Several artifact filenames and origins can share one file. Repository-key formats depend on Resolver version and configuration; newer versions can include a URL hash.
Mammoth preserves the file verbatim. Resolver uses it to decide whether downloaded bytes are available under the active remote context. Changing repository IDs or effective mirror IDs can require a new download and can make an offline build fail. Removing the marker changes that behavior: in the tested Resolver, untracked bytes are accepted even when their former origin is absent from the build.
Markers do not establish cryptographic provenance or fully encode settings. For example, the tested Resolver configuration accepts the previous bytes when the repository ID stays the same and only its URL changes. Mammoth does not override that behavior. See the upstream local repository documentation and repository key documentation.
Directory consistency in distributed mode
For managed files under repository/, a changed file causes all managed files in its immediate
directory to be included as upserts. This can increase payload sizes when a version has many
classifiers. It carries the worker’s artifact bytes and origin marker
together, including siblings whose timestamps did not change. It does not replicate deletions.
Under the strict policy, competing worker directories must have equivalent
managed members and contents. The codec has bounded comparison rules for
portable metadata. Origin differences or differing artifact membership can
still fail the merge. allow-duplicate-dependent-delta-paths applies to ordinary
path conflicts and does not override Maven directory validation.
Opt-in partition conflict-handling: choose-worker-directory elects the producer
with the smallest job name in JavaScript UTF-16 ordinal order and retains its
complete immediate-directory contribution. Membership differences trigger the
same election as content differences. It does not combine properties, bytes or
attributes from losing workers. The policy is limited to aggregate Maven
repository partitions and participates in their model and family identity. This trades the losing workers’ cache
contents and resolution contexts for one actual producer view. Usage-only
packages cannot win; forwarding changes producer identity. Different directories
can elect different producers. See configuration.
Before live installation, Mammoth checks selected incoming views against target siblings, including protected non-transient files outside cache ownership. An incoming marker cannot displace the provenance of an excluded artifact. GC retains the whole coordinate when a protected non-transient sibling survives. Resolver check-state files and locks are exempt. Use whole-directory exclusions to preserve selected coordinates outside managed publication.
The qualified topology uses the enhanced local repository manager with its default
_remote.repositories tracking filename and unsplit repository/ layout under a dedicated Maven
user home. The default strict policy uses a common seeded repository and compatible
Resolver/repository configuration, with one writer for each changed directory.
The opt-in directory policy instead accepts discarding other workers’ complete
directory contributions, retaining the same target-completeness checks. Custom marker filenames and split layouts have not been
qualified. Workers may add different artifact/version directories. Independent workers adding different classifiers, origins,
or local installs to the same version directory can fail aggregation. Seed shared plugin and
transitive dependencies in one job first, serialize overlapping resolution, or use standalone mode.
Finish Maven and other repository consumers before Mammoth prepares or posts.
An installation failure can leave retained local state. Inspect the original
root and use a fresh dedicated root for a new aggregator invocation.
Activity and garbage collection
Current path-only usage of a repository file protects its managed siblings, including the marker. If any file in the immediate directory survives timestamp GC, the whole managed directory survives. If every non-transient file is eligible for GC, the directory’s files can be evicted together. Before deleting any managed files, GC rejects a plan that would leave an excluded artifact sibling behind. It checks for remaining non-transient siblings again before removing a marker. Thus an old marker timestamp or missed marker atime cannot by itself strip origin evidence from retained bytes. Markers are deleted after artifact files so an interrupted GC sweep retains provenance for surviving bytes. Native timestamp misses can still evict a wholly inactive-looking directory and require downloads. Warm usage-only worker envelopes remain payload-free.
Excluded check state and locks
Three patterns remain hard exclusions in every Maven partition:
| Pattern | Reason |
|---|---|
**/*.lastUpdated |
Artifact resolution failure/check state can suppress retries after restore. |
**/resolver-status.properties |
Metadata update-check timestamps and errors can suppress fresh checks. |
**/*.lock |
Resolver synchronization state should be recreated in the consuming job. |
The first two exclusions discard update-check history; they do not remove Maven metadata XML or origin markers, and do not guarantee that every invocation downloads fresh snapshots. Resolver’s update policy still governs resolution. Lock files have different semantics from either category; there is no assumption that every lock file contains a PID.
Wrapper distributions: wrapper/dists/
When projects use the Maven Wrapper, the Wrapper script downloads the Maven distribution into
~/.m2/wrapper/dists/. The distribution is identified by its URL, making the path
deterministic and portable. This directory is covered by the wrapper-dists partition.
Compatibility and tested behavior
Removing the marker hard exclusion changes the partition fingerprint and therefore the Maven cache family. Old generations and worker packages do not match the new family; there is no fallback to marker-stripped entries. Cold-seed with a fresh dedicated Maven user home so an existing untracked local repository does not carry earlier ambiguity into the new family. Gradle’s layout is unchanged.
make integration-test-maven-repository-semantics uses the installed Maven distribution’s actual
Resolver, enhanced local repository manager, and file transport against controlled local remotes.
It also exercises Mammoth’s cache archive paths, worker packages, aggregation, and cutoff GC.
The archive test compares restored repositories with independently populated native repositories,
including artifact bytes and origin entries. It requires same-origin offline reuse and rejects
different-origin offline reuse while markers are retained. Removing the marker instead permits
offline reuse of the original bytes across origins.
Online byte selection remains Resolver behavior. Probes with Maven 3.9.15 components and Resolver 1.9.27 retain the cached bytes after checking that the artifact exists at the other remote, adding that remote to the origin entries. Maven 3.10.0 / Resolver 2.0.24 defaults to downloading the other remote’s bytes. Both behaviors occur with native and restored repositories. See Resolver’s existence-check relabel configuration. Preserving markers does not guarantee a fresh download when changing origins.
The full suite was initially qualified with Maven 3.10.0, Resolver 2.0.24, Java 21.0.12 on Linux.
Local installs remain available
across remote changes. Timestamped snapshots honor the tested never and always update policies.
Other Maven/Resolver versions and native platforms require their own qualification.