Leiningen "Could not find artifact" in CI
Leiningen asked a Maven repository for a dependency and got nothing back. The coordinates are wrong, the repo is missing, or the download failed.
What this error means
lein deps or a build fails with Could not find artifact group:artifact:jar:version or Could not transfer artifact, listing the repos tried. Valid coordinates that fail to transfer are usually transient.
Could not transfer artifact org.example:widget:jar:1.4.0 from/to clojars
(https://repo.clojars.org/): connect timed out
Could not find artifact org.example:widget:jar:1.4.0Common causes
Wrong coordinates
A typo in the group, artifact, or version means no such artifact exists in any configured repository.
Repository not configured
The artifact lives in a repo (a private Maven or a non-default one) not listed in project.clj.
Transient transfer failure
The coordinates are valid but the download to Clojars/Maven Central timed out; a re-run succeeds.
How to fix it
Verify coordinates and repos
Confirm the exact coordinates and add any non-default repository.
:dependencies [[org.example/widget "1.4.0"]]
:repositories [["internal" {:url "https://maven.example.com"}]]Add credentials for private repos
- Store repo credentials in CI secrets, not project.clj.
- Reference them via
:username/:passwordenv lookups. - Confirm the runner can reach the repo host.
Re-run on transient transfer errors
A connect-timeout on valid coordinates usually clears on retry. On Latchkey managed runners, self-healing auto-retries transient artifact transfer failures.
How to prevent it
- Pin exact dependency versions.
- Configure all needed repositories.
- Cache the local Maven (~/.m2) directory.