Fork me on GitHub
#tools-deps
<
2018-09-30
>
krukow12:09:08

Running into an issue migrating from lein to tools deps. REPL works, but when I try to uberjar the project I get the following error: Exception in thread "main" org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.httpcomponents:httpcore:jar:4.4.9 https://gist.github.com/krukow/b2b6ef6536cb8cf07cc8f613afaa8108 Would someone here be kind enough to help be figure out what's going on?

krukow12:09:28

Hmmm - resolved by cleaning .m2 and adding

:mvn/repos {"central" {:url ""}
             "clojars" {:url ""}}

krukow12:09:55

did this mean I had a corrupt .m2

Alex Miller (Clojure team)12:09:03

Those repos are already included by default so shouldn’t need those

krukow12:09:31

thanks Alex - I'll remove and simplify, I think I'll clean the entire .m2 and re-build

krukow12:09:56

migration from lein to deps was very easy 🙂 thanks!

krukow13:09:42

wait - this is weird ... I'll double check but what I'm seeing now is

krukow13:09:23

removing :mvn/repos from deps.edn => results in the above ArtifactDescriptorException: exception

krukow13:09:38

adding

:mvn/repos {"central" {:url ""}
             "clojars" {:url ""}}
=> uberjar builds

krukow13:09:06

not happy about using http though

krukow13:09:52

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 org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:192)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:253)
	at clojure.tools.deps.alpha.extensions.maven$eval2646$fn__2648.invoke(maven.clj:79)
	at clojure.lang.MultiFn.invoke(MultiFn.java:243)
	at clojure.tools.deps.alpha$expand_deps.invokeStatic(alpha.clj:170)
	at clojure.tools.deps.alpha$expand_deps.invoke(alpha.clj:152)
	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)

krukow13:09:01

this is independent of the state of the .m2 dir

krukow13:09:16

seems that this call cambada.uberjar$get_dep_jars.invokeStatic(uberjar.clj:109) => clojure.tools.deps.alpha$resolve_deps behaves differently depending on whether I have

:mvn/repos {"central" {:url ""}
             "clojars" {:url ""}}
or not in deps.edn

seancorfield20:09:40

@krukow I just tried with your deps.edn and that build command and it worked just fine. I got this warning tho'

Warning: The Main-Class specified does not exist within the jar. It may not be executable as expected. A gen-class directive may be missing in the namespace which contains the main method, or the namespace has not been AOT-compiled.