ArtifactDescriptorException: Failed to read artifact descriptor when running uberjar
krukow opened this issue · comments
Karl Krukow commented
I'm experiencing an exception
Exception in thread "main" org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.httpcomponents:httpcore:jar:4.4.9
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:323)
...
at clojure.tools.deps.alpha$resolve_deps.invokeStatic(alpha.clj:215)
at clojure.tools.deps.alpha$resolve_deps.invoke(alpha.clj:197)
at cambada.uberjar$get_dep_jars.invokeStatic(uberjar.clj:109)
at cambada.uberjar$get_dep_jars.invoke(uberjar.clj:107)
...
when running clj -A:uberjar -Srepro -Sforce
on OS X High Sierra.
I've attached the simplest repro I could make for this.
This reproduces from a clean install:
- empty ~/.m2 and ~/.clojure,
brew install clojure
- run:
clj -Sdeps '{:deps
{seancorfield/clj-new
{:git/url "https://github.com/seancorfield/clj-new"
:sha "21ca1b27f46dc324be084ba839beca555aeda387"}}}' \
-m clj-new.create \
app \
krukow/artifact-exception
- Add to
deps.edn
{:paths ["resources" "src"]
:deps {org.clojure/clojure {:mvn/version "1.9.0"}
clj-http {:mvn/version "3.8.0"}}
:aliases
{:uberjar
{:extra-deps
{luchiniatwork/cambada {:mvn/version "1.0.0"}}
:main-opts ["-m" "cambada.uberjar"
"-m" "krukow.artifact-exception"]}}
}
However, if I add
:mvn/repos {"central" {:url "http://central.maven.org/maven2/"}
"clojars" {:url "https://repo.clojars.org/"}}
things work as expected (I'm not interested in this since it's using http).
Karl Krukow commented
As discussed in Clojure Slack #tools-deps: "Cambada doesn't consider the system deps.edn file."
Amar Mehta commented
Karl Krukow commented
Awesome. Thanks!