3

I'm using Leiningen 2 and am struggling to get it to recognize the local repository ($HOME/.m2)

I'm trying to use the storm-rdbms(storm-contrib) which is not on clojar

Here are the steps I've taken:

  1. Using the lein-localrepo plugin, installed storm-rdbms under the .m2 local repository
  2. The pom.xml shows this:

    <groupId>storm-rdbms</groupId>
    <artifactId>storm-rdbms</artifactId>
    <versioning>
        <versions>
          <version>0.1-SNAPSHOT</version>
        </versions>
    <lastUpdated>20130214173431</lastUpdated>
    </versioning>
    
  3. my project.clj file :

     :dependencies [[org.clojure/clojure "1.4.0"]
                    [storm "0.8.2"]
                    [storm-rdbms "0.1-SNAPSHOT"]]
     :plugins [[lein-localrepo "0.4.1"]]
     :repositories {"local" ~(str (.toURI (java.io.File. "~/.m2")))})
    
  4. I run lein deps:

     Could not find artifact storm-rdbms:storm-rdbms:jar:0.1-SNAPSHOT
     This could be due to a typo in :dependencies or network issues.
     Could not resolve dependencies
    

I've tried this with Maven as well, but Maven 3 is not even able to install the jar when following the directions from here.

Please shed some light on what I'm doing wrong here. Thanks so much!

Florie
  • 251
  • 3
  • 9
  • Do you specifically want to have it setup as a local repo? If not, you could [use the git repo as a dependency](http://stackoverflow.com/questions/9051516/clojure-and-leiningen-using-a-git-repository-as-dependency). – sinemetu1 Feb 14 '13 at 19:11
  • Thanks. I will give that a try but I'm trying not to have too many plugins... – Florie Feb 15 '13 at 20:37

1 Answers1

2

when you run mvn install, storm-rdbms seems not to ?properly? install a pom when it installs the jar, which was preventing lein from finding it.

here are the full steps I used:

git clone git://github.com/nathanmarz/storm-contrib.git
cd storm-contrib/storm-rdbms/
mvn install
cp pom.xml ~/.m2/repository/storm/storm-rdbms/0.1-SNAPSHOT/storm-rdbms.pom  

cd ~/my-storm-project 
emacs project.clj and add this dep:
 [storm/storm-rdbms "0.1-SNAPSHOT"]
lein deps

I'm not sure if this is because it's a sub project. I was unable to build the parent project because one of the other sub-projects was broken when I checked it out...

Arthur Ulfeldt
  • 90,827
  • 27
  • 201
  • 284
  • Hi Arthur thanks for your reply. I tried your steps and at mvn install It looks like storm-contrib-sqs did not build suscessfully. I removed that from the parent pom and it seems to have worked. Also thank you for pointing out that I have to copy the pom.xml over to the m2 repository. :) it works now. – Florie Feb 15 '13 at 20:36