Find file
Fetching contributors…
Cannot retrieve contributors at this time
81 lines (44 sloc) 1.81 KB


Leiningen plugin to execute tasks on sub-projects

Should you need recursive behavior, consider Leiningen aliases or lein-cascade.


Lein 2 users

Either install as a plugin in ~/.lein/profiles.clj:

{:user {:plugins [[lein-sub "0.3.0"]]}}

Or, specify as a plugin in project.clj:

:plugins [[lein-sub "0.3.0"]]

Leiningen 1.x users

Either install as a plugin:

$ lein plugin install lein-sub "0.1.2"

Or, include as a dev-dependency in project.clj:

:dev-dependencies [[lein-sub "0.1.2"]]


Your project may have sub-projects (each having its own project.clj file) - you can specify them as follows:

:sub ["module/foo-common" "module/dep-vendor-xyz"]

Execute the plugin:

$ lein sub deps   # runs "lein deps" on each of 'foo-common' and 'dep-vendor-xyz'

$ lein sub jar      # runs "lein jar" on both
$ lein sub install  # install both sub-project artifacts to local Maven repo

You can pass subproject directory locations via command line (overrides :sub):

$ lein sub -s "module/foo-common:module/dep-vendor-xyz" jar

Getting in touch

On Twitter: @kumarshantanu

On E-mail: kumar.shantanu(at)

On Leiningen mailing list:



Copyright © 2011-2013 Shantanu Kumar and contributors

Adapted from Phil Hagelberg's example:

Distributed under the Eclipse Public License, the same as Clojure.