Skip to content
Latchkey

Scala sbt "ResolveException: unresolved dependency" in CI

sbt asked its configured resolvers for a module and none returned a matching artifact. It raises sbt.librarymanagement.ResolveException and lists the organization, name, and revision it could not download.

What this error means

sbt update or compile stops with "[error] sbt.librarymanagement.ResolveException: Error downloading <org>:<name>:<rev>" and "unresolved dependency" lines naming the coordinates.

sbt
[error] sbt.librarymanagement.ResolveException: Error downloading com.example:widgets_2.13:1.4.0
[error]   Not found
[error]   not found: https://repo1.maven.org/maven2/com/example/widgets_2.13/1.4.0/widgets_2.13-1.4.0.pom
[error] Total time: 6 s, completed

Common causes

The coordinates or revision do not exist

A typo in the organization/name, or a version that was never published, means no resolver has a matching POM or JAR.

A private repository is not configured in CI

The module lives in a private Maven repo whose resolvers or credentials are present locally but missing in the CI environment.

How to fix it

Verify the exact coordinates

  1. Read the "not found" URL to see the org, name, and revision sbt tried.
  2. Confirm the artifact and version exist on the index (note the Scala suffix like _2.13).
  3. Correct the libraryDependencies line and re-run sbt update.
build.sbt
libraryDependencies += "com.example" %% "widgets" % "1.4.0"

Add the private resolver and credentials

Declare the repository and inject credentials from a CI secret so the resolver can reach private modules.

build.sbt
resolvers += "internal" at "https://maven.internal.example.com/releases"
credentials += Credentials("Internal", "maven.internal.example.com",
  sys.env("MVN_USER"), sys.env("MVN_TOKEN"))

How to prevent it

  • Pin only versions you have confirmed are published.
  • Keep private resolvers and credentials defined for CI, not just local machines.
  • Use %% so the correct Scala binary suffix is appended automatically.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →