leiningen – how to add dependencies for local jars?

Just use :resource-paths in your project.clj file. I use it, e.g. to connect to Siebel servers. Just created a resources directory in my project directory and copied the jar files in there. But of course you could use a more generic directory:

(defproject test-project "0.1.0-SNAPSHOT"
:description "Blah blah blah"
...
:resource-paths ["resources/Siebel.jar" "resources/SiebelJI_enu.jar"])

Then from the lein repl I can create Siebel Data Bean instances, e.g.

(def sbl (com.siebel.data.SiebelDataBean.))
(.login sbl "siebelServer" "user" "password")
...

If you have a newer Java version you can of course use wildcards in your path specification like this for a more general directory:

:resource-paths ["/tmp/SiebelJars/*"]

Leave a Comment