views:

660

answers:

4

if I enable eith the clojure-couchdb or swank-clojure then lein deps fails because org.apache.maven:super-pom:jar:2.0 is missing

:dependencies [[org.clojure/clojure "1.1.0-master-SNAPSHOT"]
               [org.clojure/clojure-contrib "1.0-SNAPSHOT"]
               [clojure-http-client "1.0.0-SNAPSHOT"]
               [org.apache.activemq/activemq-core "5.3.0"]
;              [org.clojars.the-kenny/clojure-couchdb "0.1.3"]
;              [org.clojure/swank-clojure "1.1.0"]
              ])

this error:

  Path to dependency: 
1) org.apache.maven:super-pom:jar:2.0
2) org.clojure:swank-clojure:jar:1.1.0

----------
1 required artifact is missing.

for artifact: 
 org.apache.maven:super-pom:jar:2.0

from the specified remote repositories:  
  clojars (http://clojars.org/repo/),
  clojure-snapshots (http://build.clojure.org/snapshots),
  central (http://repo1.maven.org/maven2)

what is super-pom. why do these packages need it and where can I get it.

+5  A: 

I think this just means that Maven wasn't able to satisfy the dependencies you specified. I've checked there's no org.clojure/swank-clojure artifact in any of the three repositories your message mentions. For clojure-couchdb, the version you're using -- as far as I can tell from looking at its project.clj file on GitHub -- depends on org.clojure/clojure-http-client "1.0.0-SNAPSHOT", which doesn't exist in the repos either.

One way around this problem is to install the jars you want into your local repo. (I can't seem to remember the exact command... will look it up in a minute. See e.g. this page for instructions.) Then Maven will just pick them up from there.

(BTW, if you want to use Clojure + contrib 1.1.0, you can just use "1.1.0" as the version strings now. That's for both org.clojure/clojure and org.clojure/clojure-contrib.)

Oh, and about the super POM -- from this page in Maven's docs:

The Super POM is Maven's default POM. All POMs extend the Super POM unless explicitly set, meaning the configuration specified in the Super POM is inherited by the POMs you created for your projects.

As for how it got into your error message, I've honestly no idea. You could add the "maven" tag to this question or just ask a separate question with that tag to get some Maven gurus onto it.

Michał Marczyk
Incidentally, not sure if this should be part of the answer proper, but if you're including a Swank dependency just to use `lein swank`, you should use a `leiningen/lein-swank "1.1.0"` instead. Also, put it in your `:dev-dependencies` (note they're still included in e.g. uberjars for now, but perhaps some day lein will be smarter...).
Michał Marczyk
i'm actually using both. leain swank as a buld dep and swank for a "remote control" into the running server. (that will probibly go when we ship this) swank is officially neeto!
Arthur Ulfeldt
That's true enough. :-) For an embedded swank, you can use a `swank-clojure "1.1.0"` dependency; see http://clojars.org/repo/swank-clojure/swank-clojure/ for a list (of sorts) of the available versions. I've tested this with `lein deps` and it works fine!
Michał Marczyk
Ok, I think I've got an idea which may work for you... How about putting `org.clojure/clojure-http-client` on the `:exclusions` list in `lein` and have your project explicitly depend on `clojure-http-client` (I think no groupId is required; the current version on Clojars seems to be `1.0.0-SNAPSHOT`)? This way `clojure-couchdb` should be able to find all the `clojure-http-client`'s namespaces it needs while lein / Maven will be able to fetch your deps. I think you'll have to run some code using `clojure-couchdb` to test this; let me know how it works out.
Michał Marczyk
+2  A: 

I think it's still common that projects have broken dependencies. It's unfortunate, because it really mars the experience.

My solution is to go onto http://clojars.org and search for the library I need. Usually there are a few versions. I do a little research on http://github.com to see which one is most up to date. Then I try that one as a dependency. If it works, great! Otherwise, I try another one.

It's a long process, but I think it is getting better. You should have seen the process before!

Eric Normand
+1  A: 

I'm getting the same error on the maven super-pom dependency, and when I do

$ sudo lein deps

It runs without error. Not an ideal solution, but it works for me.

yayitswei
sudo lein deps will install the deps to /root/.m2 instead of /home/you/.m2/ you would likely get the same result by first deleting /home/you/.m2/?
Arthur Ulfeldt
I have no /root on my Mac, but at least removing .m2 fixed it. I also had to re-install Leiningen of course.
Pepijn
A: 

I accidentally uploaded swank-clojure to the org.clojure group about a year ago. I deleted it soon after since I'm not associated with that group, so that's why it can't be found. Can I ask where you found the instructions with the erroneous version so it can be corrected?

technomancy