Tech behind Tech

Raw information. No finesse :)

Leiningen – Adding git submodule to Leiningen project

with 4 comments

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 :)

Written by Siva Jagadeesan

December 11, 2010 at 1:39 pm

Posted in Clojure

Tagged with , ,

4 Responses

Subscribe to comments with RSS.

  1. What version of Lein are you doing this with? Doesn’t seem to work with v1.3.1


    December 11, 2010 at 11:42 pm

    • It does seem to work in v1.3.1.

      lein classpath

      Siva Jagadeesan

      December 12, 2010 at 12:38 am

  2. This is a useful feature,

    but, you will need to include all of the module dependencies manually, “lein deps” will not look into submodules


    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


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


      December 16, 2011 at 8:54 pm

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 147 other followers

%d bloggers like this: