sbt "Resolve failed: unresolved dependency scala-library" in CI
sbt could not resolve the Scala standard library itself. Either the configured scalaVersion does not exist on the resolvers, or the network fetch to Maven Central failed.
What this error means
Resolution aborts with unresolved dependency: org.scala-lang#scala-library;<version>: not found. A bad version is deterministic; a fetch failure on a valid version is transient.
[error] (update) sbt.librarymanagement.ResolveException: Error downloading
[error] org.scala-lang:scala-library:2.13.99
[error] Not found
[error] unresolved dependency: org.scala-lang#scala-library;2.13.99Common causes
Nonexistent scalaVersion
scalaVersion is set to a version that was never published, so the standard library JAR cannot be found anywhere.
Resolver unreachable
Maven Central or the configured mirror is blocked, so even a valid scala-library version cannot be downloaded.
Transient registry failure
The version is valid and the resolver is configured, but the download times out or returns 5xx and succeeds on a re-run.
How to fix it
Pin a real Scala version
Set scalaVersion to a published release.
scalaVersion := "2.13.14"Verify resolver reachability
- Confirm Maven Central (or your mirror) is reachable from the runner.
- Check any proxy and CA certificate configuration.
- Cache the Coursier/Ivy directory to avoid repeated fetches.
Re-run on transient fetch failures
A Not found on a valid version is usually a registry blip. Latchkey managed runners self-heal transient dependency fetch failures by auto-retrying so one network blip does not fail the job.
How to prevent it
- Pin scalaVersion to a known release.
- Cache the Coursier/Ivy cache between runs.
- Keep mirror URLs and proxy config correct.