Leiningen – Adding git submodule to Leiningen project
With git, sometimes it easy to use git submodule for dependency management. In Leiningen, for some reason the only “advertised” way of dependency management is using maven. After some poking around, there is a way in Leiningen to use git submodules for dependency management.
Are you ready? ( drumroll …)
It is very simple actually
You have to checkout your submodules to “checkouts” folder. Leiningen will automatically add your submodule’s src directory to your classpath.
That’s it folks

What version of Lein are you doing this with? Doesn’t seem to work with v1.3.1
Amit
December 11, 2010 at 11:42 pm
It does seem to work in v1.3.1.
lein classpath
/Users/admin/work/clojure/clj/src:/Users/admin/work/clojure/clj/test:/Users/admin/work/clojure/clj/classes:/Users/admin/work/clojure/clj/resources:/Users/admin/work/clojure/clj/test-resources:/Users/admin/work/clojure/clj/checkouts/leiningen/src:/Users/admin/work/clojure/clj/checkouts/leiningen/classes:/Users/admin/work/clojure/clj/checkouts/leiningen/resources:/Users/admin/work/clojure/clj/lib/clojure-1.2.0.jar:/Users/admin/work/clojure/clj/lib/clojure-contrib-1.2.0.jar:/Users/admin/work/clojure/clj-bob/lib/dev/swank-clojure-1.2.1.jar
Siva Jagadeesan
December 12, 2010 at 12:38 am
This is a useful feature,
but, you will need to include all of the module dependencies manually, “lein deps” will not look into submodules
dave
December 16, 2011 at 8:22 pm
however, if you add the :checkout-deps-shares option this can be resolved and you can include these dependencies
e.g:
:checkout-deps-shares [:source-path :test-path
~(fn [p] (str (:root p) “/lib/*”))]
I am not sure, yet, as to whether this will work if you had more checkouts in a checkouts module.
My suspicion would be no. but I have not looked.
dave
December 16, 2011 at 8:54 pm