sbt "Coursier" Resolution Fails in CI
sbt’s Coursier resolver could not assemble the dependency graph. Either an artifact genuinely is not on the configured resolvers, a resolver is missing, or a repository returned a transient error.
What this error means
sbt update/compile fails with a Coursier "not found" or resolution error naming a module and the repositories it searched. A missing-artifact case fails every time; a transient repo error passes on retry.
[error] Error downloading com.example:widgets_2.13:1.4.0
[error] not found: https://repo1.maven.org/maven2/com/example/widgets_2.13/1.4.0/...
[error] not found: /root/.ivy2/local/com.example/widgets_2.13/1.4.0/...Common causes
Artifact not on the configured resolvers
The module lives on a repository not declared in resolvers, or the version/cross-version does not exist, so Coursier finds it nowhere.
Transient repository error
A 5xx or reset from Maven Central / a mirror interrupts resolution. These clear on retry and are unrelated to your build definition.
How to fix it
Declare the resolver and verify the coordinates
Add the repository hosting the artifact and confirm the version/cross-version exists.
// build.sbt
resolvers += "Internal" at "https://your-org.example.com/maven"
libraryDependencies += "com.example" %% "widgets" % "1.4.0"Retry and cache for transient errors
for i in 1 2 3; do sbt update && break || sleep 15; done
# cache ~/.cache/coursier and ~/.ivy2/cache between runsHow to prevent it
- Declare every resolver your dependencies need.
- Cache
~/.cache/coursierand~/.ivy2/cachekeyed on build files. - Use
%%and pinscalaVersionso cross-version artifacts resolve.