1
votes

I'm having trouble using local jars in my project. I've built the jars and installed them with localrepo.

$ lein localrepo install opencv-249.jar opencv/opencv 2.4.9
$ lein localrepo install opencv-native-249.jar opencv/opencv-native 2.4.9

The jars show up in the local repo list.

$ lein localrepo list | grep opencv
opencv/opencv-native (2.4.9)
opencv (2.4.9)

I then included opencv in my project.clj with [opencv/opencv "2.4.9"]. But leiningen can't find the jar when I run the project:

$ lein run
Could not find artifact opencv:opencv:jar:2.4.9 in central (http://repo1.maven.org/maven2/)
Could not find artifact opencv:opencv:jar:2.4.9 in clojars (https://clojars.org/repo/)
Could not find artifact opencv:opencv:jar:2.4.9 in project (file:repo)
This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.

I wonder if the problem is specific to opencv since I've used localrepo successfully for other jars.

This is my project.clj: https://www.refheap.com/86337

1
What does your project.clj file look like? I did the same thing for opencv 3.0.0 a while back, I remember compiling on my Mac was the hard part but then it worked fine within my project.Diego Basch
Updated the question with a link to the project.clj. Thanks!yayitswei
What do you have under ~/.m2/repository/opencv/opencv/2.4.9/ ?Diego Basch
Try adding the localrepo as a plugin in your project.clj and maybe also set the localrepo directory explicitly in your project.clj.schaueho
@DiegoBasch $ ls ~/.m2/repository/opencv/opencv/2.4.9/ _maven.repositories opencv-2.4.9.jar opencv-2.4.9.pomyayitswei

1 Answers

4
votes

If its okay for you to ship these custom jars with the project, you can put these in a folder and instead of installing to local repo you can add the following to your project.clj

 :resource-paths ["lib/my-custom.jar"]