Leiningen "Could not transfer artifact" from clojars in CI
Leiningen found the coordinate but the transfer itself failed. Unlike "could not find artifact", this is a connectivity, TLS, or proxy problem between the runner and the Maven repository, not a missing dependency.
What this error means
Dependency resolution fails with "Could not transfer artifact GROUP:ARTIFACT from/to clojars" followed by a connection reset, timeout, or PKIX certificate error.
Could not transfer artifact org.clojure/clojure:pom:1.11.1 from/to clojars
(https://repo.clojars.org/): Connection reset
Failed to read artifact descriptor for org.clojure/clojure:jar:1.11.1Common causes
Transient network failure to the repository
A dropped connection, DNS blip, or momentary clojars slowness interrupts the transfer mid-download.
A proxy or TLS interception between runner and repo
A corporate proxy or missing CA breaks the HTTPS transfer, surfacing as a connection reset or PKIX path error.
How to fix it
Retry the resolution
Most transfer failures are transient. Re-run dependency resolution, ideally with a warmed ~/.m2 cache so only the missing artifacts are fetched.
lein deps || lein depsConfigure the proxy or CA the runner needs
Route Leiningen through the proxy and trust the corporate CA so the HTTPS transfer completes.
export JAVA_TOOL_OPTIONS="-Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=8080"
export HTTP_CLIENT_OPTS="-Djavax.net.ssl.trustStore=/etc/ssl/corp.jks"How to prevent it
- Cache
~/.m2/repositoryacross CI runs to shrink the transfer surface. - Trust the corporate CA in the runner keystore instead of disabling TLS.
- Point CI at a reliable Maven mirror when clojars is congested.