Skip to content
Latchkey

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.

sbt
[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.99

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

build.sbt
scalaVersion := "2.13.14"

Verify resolver reachability

  1. Confirm Maven Central (or your mirror) is reachable from the runner.
  2. Check any proxy and CA certificate configuration.
  3. 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.

Frequently asked questions

What causes ""unresolved dependency: scala-library""?
scalaVersion is set to a version that was never published, so the standard library JAR cannot be found anywhere.
How do I fix "unresolved dependency: scala-library"?
Set scalaVersion to a published release.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card