Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Friend requires old version of ring #15

Closed
JulioBarros opened this issue Jun 26, 2012 · 4 comments
Closed

Friend requires old version of ring #15

JulioBarros opened this issue Jun 26, 2012 · 4 comments

Comments

@JulioBarros
Copy link

Friend specifies an old version of ring that does not have the head middleware needed by compojure.route causing:

"Caused by: java.io.FileNotFoundException: Could not locate ring/middleware/head__init.class or ring/middleware/head.clj on classpath:"

  • Sorry if this is not really an issue I'm not yet quite sure how to resolve all these various dependencies. Thanks.
@cemerick
Copy link
Owner

Interesting; the later dependency that compojure requires should override friend's. I am loathe to change Friend's ring dependency version, as it actually doesn't require anything newer.

What version of Leiningen are you using? If you're using Leiningen 1.x, try deleting lib within your project, and run lein deps to resolve dependencies again.

@JulioBarros
Copy link
Author

I'm using

Leiningen 2.0.0-preview6 on Java 1.6.0_33 Java HotSpot(TM) 64-Bit Server VM

was able to work around it with an exclusion

[com.cemerick/friend "0.0.9" :exclusions [ring/ring-core]]

Julio

On Jun 26, 2012, at 11:29 AM, Chas Emerick reply@reply.github.com wrote:

Interesting; the later dependency that compojure requires should override friend's. I am loathe to change Friend's ring dependency version, as it actually doesn't require anything newer.

What version of Leiningen are you using? If you're using Leiningen 1.x, try deleting lib within your project, and run lein deps to resolve dependencies again.


Reply to this email directly or view it on GitHub:
#15 (comment)

@xeqi
Copy link

xeqi commented Jun 27, 2012

I explored this briefly in case it was a lein/pomegranate issue when it was mentioned in irc. It can be reproduced with:

:dependencies [[org.clojure/clojure "1.4.0"]
                 [com.cemerick/friend "0.0.9"]
                 [noir "1.3.0-beta9"]

Dependency trees:

vagrant@natty64:/workspace/tmp/blah$ lein deps :tree
 [com.cemerick/friend "0.0.9"]
   [commons-codec "1.6"]
   [net.sourceforge.nekohtml/nekohtml "1.9.10"]
     [xerces/xercesImpl "2.8.1"]
       [xml-apis "1.3.03"]
   [org.apache.httpcomponents/httpclient "4.2-beta1"]
     [org.apache.httpcomponents/httpcore "4.2-beta1"]
   [org.clojure/core.incubator "0.1.0"]
   [org.mindrot/jbcrypt "0.3m"]
   [org.openid4java/openid4java-nodeps "0.9.6"]
     [com.google.code.guice/guice "2.0"]
     [commons-logging "1.1.1"]
     [net.jcip/jcip-annotations "1.0"]
   [ring/ring-core "1.0.2"]
     [commons-fileupload "1.2.1"]
     [commons-io "1.4"]
     [javax.servlet/servlet-api "2.5"]
   [robert/hooke "1.1.2"]
   [slingshot "0.10.2"]
 [noir "1.3.0-beta9"]
   [bultitude "0.1.5"]
   [clj-stacktrace "0.2.4"]
   [compojure "1.0.4"]
     [clout "1.0.1"]
   [hiccup "1.0.0"]
   [lib-noir "0.1.0"]
     [cheshire "4.0.0"]
       [com.fasterxml.jackson.core/jackson-core "2.0.0"]
       [com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.0.0"]
   [org.clojure/tools.macro "0.1.1"]
   [ring "1.1.1"]
     [ring/ring-devel "1.1.1"]
       [ns-tracker "0.1.1"]
         [org.clojure/tools.namespace "0.1.0"]
           [org.clojure/java.classpath "0.1.0"]
     [ring/ring-jetty-adapter "1.1.1"]
       [org.eclipse.jetty/jetty-server "7.6.1.v20120215"]
         [org.eclipse.jetty.orbit/javax.servlet "2.5.0.v201103041518"]
         [org.eclipse.jetty/jetty-continuation "7.6.1.v20120215"]
         [org.eclipse.jetty/jetty-http "7.6.1.v20120215"]
           [org.eclipse.jetty/jetty-io "7.6.1.v20120215"]
             [org.eclipse.jetty/jetty-util "7.6.1.v20120215"]
     [ring/ring-servlet "1.1.1"]
 [org.clojure/clojure "1.4.0"]
[INFO] blah:blah:jar:0.1.0-SNAPSHOT
[INFO] +- org.clojure:clojure:jar:1.4.0:compile
[INFO] +- com.cemerick:friend:jar:0.0.9:compile
[INFO] |  +- ring:ring-core:jar:1.0.2:compile
[INFO] |  |  +- commons-io:commons-io:jar:1.4:compile
[INFO] |  |  +- commons-fileupload:commons-fileupload:jar:1.2.1:compile
[INFO] |  |  \- javax.servlet:servlet-api:jar:2.5:compile
[INFO] |  +- slingshot:slingshot:jar:0.10.2:compile
[INFO] |  +- robert:hooke:jar:1.1.2:compile
[INFO] |  +- org.clojure:core.incubator:jar:0.1.0:compile
[INFO] |  +- org.mindrot:jbcrypt:jar:0.3m:compile
[INFO] |  +- commons-codec:commons-codec:jar:1.6:compile
[INFO] |  +- org.openid4java:openid4java-nodeps:jar:0.9.6:compile
[INFO] |  |  +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] |  |  +- com.google.code.guice:guice:jar:2.0:compile
[INFO] |  |  \- net.jcip:jcip-annotations:jar:1.0:compile
[INFO] |  +- net.sourceforge.nekohtml:nekohtml:jar:1.9.10:compile
[INFO] |  |  \- xerces:xercesImpl:jar:2.8.1:compile
[INFO] |  |     \- xml-apis:xml-apis:jar:1.3.03:compile
[INFO] |  \- org.apache.httpcomponents:httpclient:jar:4.2-beta1:compile
[INFO] |     \- org.apache.httpcomponents:httpcore:jar:4.2-beta1:compile
[INFO] \- noir:noir:jar:1.3.0-beta9:compile
[INFO]    +- lib-noir:lib-noir:jar:0.1.0:compile
[INFO]    |  \- cheshire:cheshire:jar:4.0.0:compile
[INFO]    |     +- com.fasterxml.jackson.core:jackson-core:jar:2.0.0:compile
[INFO]    |     \- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.0.0:compile
[INFO]    +- compojure:compojure:jar:1.0.4:compile
[INFO]    |  \- clout:clout:jar:1.0.1:compile
[INFO]    +- bultitude:bultitude:jar:0.1.5:compile
[INFO]    +- ring:ring:jar:1.1.1:compile
[INFO]    |  +- ring:ring-devel:jar:1.1.1:compile
[INFO]    |  |  \- ns-tracker:ns-tracker:jar:0.1.1:compile
[INFO]    |  |     \- org.clojure:tools.namespace:jar:0.1.0:compile
[INFO]    |  |        \- org.clojure:java.classpath:jar:0.1.0:compile
[INFO]    |  +- ring:ring-jetty-adapter:jar:1.1.1:compile
[INFO]    |  |  \- org.eclipse.jetty:jetty-server:jar:7.6.1.v20120215:compile
[INFO]    |  |     +- org.eclipse.jetty.orbit:javax.servlet:jar:2.5.0.v201103041518:compile
[INFO]    |  |     +- org.eclipse.jetty:jetty-continuation:jar:7.6.1.v20120215:compile
[INFO]    |  |     \- org.eclipse.jetty:jetty-http:jar:7.6.1.v20120215:compile
[INFO]    |  |        \- org.eclipse.jetty:jetty-io:jar:7.6.1.v20120215:compile
[INFO]    |  |           \- org.eclipse.jetty:jetty-util:jar:7.6.1.v20120215:compile
[INFO]    |  \- ring:ring-servlet:jar:1.1.1:compile
[INFO]    +- hiccup:hiccup:jar:1.0.0:compile
[INFO]    +- clj-stacktrace:clj-stacktrace:jar:0.2.4:compile
[INFO]    \- org.clojure:tools.macro:jar:0.1.1:compile

Both pomegranate/mvn get the same thing so I wasn't concerned about it being a bug. I think it happens because MavenRepositorySystemSession uses a NearestVersionConflictResolver as part of its DependencyGraphTransformer. I think the NearestVersionConflictResolver ends up choosing ring/core 1.0.2 because it is only one level deep in transitive dependencies.

@cemerick
Copy link
Owner

Using [com.cemerick/friend "$VERSION" :exclusions [ring/ring-core]] will have to be the "official" workaround until something can be done to smooth this general problem over in Leiningen (see nrepl/drawbridge#8 for another example).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants