luchiniatwork / cambada

Packager for Clojure based on deps.edn (AKA tools.deps). Supporting jar, uberjar and GraalVM's native-image.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ArtifactDescriptorException: Failed to read artifact descriptor when running uberjar

krukow opened this issue · comments

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:

  1. empty ~/.m2 and ~/.clojure,
  2. brew install clojure
  3. 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
  1. 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).

simple-repro.zip

As discussed in Clojure Slack #tools-deps: "Cambada doesn't consider the system deps.edn file."

Hi @krukow Ran into the same thing a few days ago and saw your comments in #tools-deps. This issue should be addressed by #14 if it gets accepted.

Awesome. Thanks!