Global exclusions not honored #498

Closed
kurtharriger opened this Issue Apr 4, 2012 · 6 comments

Projects

None yet

3 participants

@kurtharriger

I'm getting an issue resolving dependencies from projects built with gradle using version ranges. http://issues.gradle.org/browse/GRADLE-1578?focusedCommentId=15224#comment-15224

In lein 1.7 adding an exclusion and specifying the desired version solves the problem... however the exclusion does not work with lein 2 for some reason.

:exclusions [...
org.apache.thrift/thrift
org.apache.thrift/libthrift]

Exception in thread "main" java.lang.RuntimeException: org.sonatype.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: org.apache.thrift:libthrift:jar:0.6+, com.sun.jdmk:jmxtools:jar:1.2.1, com.sun.jmx:jmxri:jar:1.2.1: Could not find artifact org.apache.thrift:libthrift:jar:0.6+ in central (http://repo1.maven.org/maven2)
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:35)
at cemerick.pomegranate.aether$resolve_dependencies.doInvoke(aether.clj:359)
at clojure.lang.RestFn.invoke(RestFn.java:805)
at leiningen.core.classpath$resolve_dependencies.doInvoke(classpath.clj:97)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at leiningen.deps$deps.invoke(deps.clj:10)
at clojure.lang.Var.invoke(Var.java:401)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.core$apply.invoke(core.clj:602)
at leiningen.core.main$resolve_task$fn__648.doInvoke(main.clj:54)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at leiningen.core.main$apply_task.invoke(main.clj:75)
at leiningen.core.main$_main.doInvoke(main.clj:124)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.lang.Var.invoke(Var.java:401)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.core$apply.invoke(core.clj:600)
at clojure.main$main_opt.invoke(main.clj:323)
at clojure.main$main.doInvoke(main.clj:426)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at clojure.lang.Var.invoke(Var.java:409)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)

@technomancy
Owner

Can you provide a repro case?

@kurtharriger

https://github.com/kurtharriger/broken-exclusions-sample-project

sh install-broken.sh
lein deps ;; => OK
lein2 deps ;; => exception

@technomancy
Owner

It looks like the repro case is missing, but I guess I should be able to substitute any arbitrary jar for it?

@technomancy
Owner

Moving :exclusions to inside the broken dependency vector fixes it, so it looks like this is just a regression regarding project-wide exclusions.

@xeqi xeqi added a commit that closed this issue Apr 5, 2012
@xeqi xeqi Handle global exclusions in all dependency cases. Fixes #498
Also remove global exclusion handling in pom generation, otherwise
it would generate 2 exclusion tags.
3076100
@xeqi xeqi closed this in 3076100 Apr 5, 2012
@xeqi
Collaborator
xeqi commented Apr 5, 2012

Fixed in master.
Realised I was doing some global exclusion stuff in pom generation that needed to get fixed at the same time, so I just took this.

@technomancy
Owner

Great, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment