Where Does Coursier Store Its Cache?
Coursier caches resolved artifacts per OS (~/.cache/coursier on Linux), overridable with COURSIER_CACHE, with a legacy ~/.coursier fallback.
Last updated
Coursier's cache is where Maven artifacts actually land, and its location has history. Modern versions use per-OS cache folders, but machines that ran ancient Coursier keep using the legacy ~/.coursier path for continuity. Both hold the same content-addressed layout mirroring repository URLs.
The environment variable wins over everything. Set COURSIER_CACHE to redirect the whole cache, per shell or per project. Build tools that embed Coursier (like sbt) respect the same variable, so one setting covers the JVM toolchain.
Where Coursier stores this, by platform
~/.cache/coursier/v1
Resolved jars mirror their repository URLs underneath. COURSIER_CACHE overrides the location entirely. Legacy ~/.coursier/cache/v1 applies on machines that ran pre-2017 versions first.
~/Library/Caches/Coursier/v1
Same content, Apple-conventional spot. The legacy ~/.coursier fallback and COURSIER_CACHE override behave identically to Linux.
%LOCALAPPDATA%\Coursier\Cache\v1
The Windows equivalent under local AppData. Same override and legacy rules; sbt on Windows reads this cache through the same resolution logic.
Frequently asked questions
The cache is not where the docs say. Why?
Check for COURSIER_CACHE first, then look for a legacy ~/.coursier folder from pre-2017 versions. The first Coursier version ever run on a machine pins the location for later ones, so old machines often use the legacy path.
How do I isolate a cache per project?
Set COURSIER_CACHE to a project-local folder before running. That scopes downloads to the project for inspection without disturbing the shared global cache.
Notice an outdated path? Let us know.