clj "Error building classpath. Could not find artifact" in CI
The Clojure CLI (clj/clojure) builds a classpath from deps.edn and could not resolve one Maven coordinate. Like Leiningen, it queries central and clojars by default, so a missing or misnamed coordinate stops classpath construction.
What this error means
A clj or clojure command fails immediately with "Error building classpath. Could not find artifact GROUP:ARTIFACT:VERSION in central (or clojars)".
Error building classpath. Could not find artifact org.example/widgets:jar:9.9.9 in central (https://repo1.maven.org/maven2/)Common causes
A wrong or unpublished coordinate in deps.edn
The :mvn/version for a dependency in :deps points at a version that does not exist, or the group/artifact symbol is misspelled.
A private repository not declared in :mvn/repos
The dependency lives in a private Maven repo, but deps.edn does not list it under :mvn/repos, so tools.deps never queries it.
How to fix it
Fix the coordinate in deps.edn
- Confirm the real coordinate on Clojars or Maven Central.
- Correct the
:mvn/version(or the group/artifact key) in:deps. - Run
clojure -Pto prepare and verify the classpath resolves.
{:deps {org.clojure/clojure {:mvn/version "1.11.1"}
org.example/widgets {:mvn/version "1.4.0"}}}Declare the private Maven repo
Add the hosting repository so tools.deps can resolve private coordinates.
{:mvn/repos {"internal" {:url "https://maven.internal.example.com/repo"}}}How to prevent it
- Verify coordinates against the index before committing deps.edn.
- Declare all non-default Maven repos under
:mvn/repos. - Cache
~/.m2/repositoryand.cpcacheso resolution is not repeated.