3
votes

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!

1
Do you specifically want to have it setup as a local repo? If not, you could use the git repo as a dependency.sinemetu1
Thanks. I will give that a try but I'm trying not to have too many plugins...Florie

1 Answers

2
votes

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...