leiningen 0,1,3,0,1,3,0,2 travis-ci

Automate Clojure projects without setting your hair on fire.

2 years after


<img src="http://leiningen.org/img/leiningen.jpg" alt="Leiningen logo" title="The man himself" align="right" />

"Leiningen!" he shouted. "You're insane! They're not creatures you can fight—they're an elemental—an 'act of God!' Ten miles long, two miles wide—ants, nothing but ants! And every single one of them a fiend from hell..."

Leiningen is for automating Clojure projects without setting your hair on fire.


If your preferred package manager offers a recent version of Leiningen, try that first. Many package managers still include version 1.x, which is rather outdated, so you may be better off installing manually.

Leiningen installs itself on the first run of the lein shell script; there is no separate install script. Follow these instructions to install Leiningen manually:

  1. Make sure you have a Java JDK version 6 or later.
  2. Download the lein script from the stable branch of this project.
  3. Place it on your $PATH. (~/bin is a good choice if it is on your path.)
  4. Set it to be executable. (chmod +x ~/bin/lein)
  5. Run it.


There is an installer which will handle downloading and placing Leiningen and its dependencies.

The manual method of putting the batch file. on your PATH and running lein self-install should still work for most users. If you have Cygwin you should be able to use the shell script above rather than the batch file.

N.B.: Avoid using a LEIN_JAR environment variable. If you have one instance of Leiningen on your PATH as well as a LEIN_JAR pointing to a different instance, there is a known problem where lein -v and lein update will refer to the first instance, while usage of Leiningen, such as lein new foobar, will refer to the latter.

Basic Usage

The tutorial has a detailed walk-through of the steps involved in creating a new project, but here are the commonly-used tasks:

$ lein new [TEMPLATE] NAME # generate a new project skeleton

$ lein test [TESTS] # run the tests in the TESTS namespaces, or all tests

$ lein repl # launch an interactive REPL session

$ lein run -m my.namespace # run the -main function of a namespace

$ lein uberjar # package the project and dependencies as standalone jar

$ lein deploy clojars # publish the project to Clojars as a library

Use lein help to see a complete list. lein help $TASK shows the usage for a specific task.

You can also chain tasks together in a single command by using the do task with comma-separated tasks:

$ lein do clean, test foo.test-core, jar

Most tasks need to be run from somewhere inside a project directory to work, but some (new, help, search, version, and repl) may run from anywhere.


The project.clj file in the project root should look like this:

(defproject myproject "0.5.0-SNAPSHOT"
  :description "A project for doing things."
  :license "Eclipse Public License 1.0"
  :url "http://github.com/technomancy/myproject"
  :dependencies [[org.clojure/clojure "1.8.0"]]
  :plugins [[lein-tar "3.2.0"]])

The lein new task generates a project skeleton with an appropriate starting point from which you can work. See the sample.project.clj file (also available via lein help sample) for a detailed listing of configuration options.

The project.clj file can be customized further with the use of profiles.


Leiningen documentation is organized as a number of guides:




Leiningen supports plugins which may contain both new tasks and hooks that modify behaviour of existing tasks. See the plugins wiki page for a full list. If a plugin is needed for successful test or build runs, (such as lein-tar) then it should be added to :plugins in project.clj, but if it's for your own convenience (such as lein-pprint) then it should be added to the :plugins list in the :user profile in ~/.lein/profiles.clj. See the profiles guide for details on how to add to your :user profile. The plugin guide explains how to write plugins.


Source Copyright © 2009-2016 Phil Hagelberg, Alex Osborne, Dan Larkin, and contributors. Distributed under the Eclipse Public License, the same as Clojure uses. See the file COPYING.

Thanks to Stuart Halloway for Lancet and Tim Dysinger for convincing me that good builds are important.

Images Copyright © 2010 Phil Hagelberg. Distributed under the Creative Commons Attribution + ShareAlike License. Full-size version available.

Related Repositories



A plugin for JetBrains' IntelliJ IDE supporting the Leiningen build system. ...



A plugin for JetBrains' IntelliJ IDE supporting the Leiningen build system. ...



DEPRECATED - The run task is now built-in to Leiningen, so this plugin is no lon ...



An example Clojure project that uses Leiningen 2 on travis-ci.org ...



Chef cookbook for Leiningen ...

Top Contributors

technomancy hyPiRion trptcolin mtyaka michaelklishin Raynes ninjudd hugoduncan cemerick danlarkin xeqi cprice404 cldwalker tobias crisptrutski dakrone winks joegallo gfredericks juergenhoetzel davidsantiago jcrossley3 danielcompton timmc ato mpblair bruceadams michalmarczyk waynr scgilardi


-   2.7.1 zip tar
-   2.7.0 zip tar
-   2.6.1 zip tar
-   2.6.0 zip tar
-   2.5.3 zip tar
-   2.5.2 zip tar
-   2.5.1 zip tar
-   2.5.0 zip tar
-   2.4.3 zip tar
-   2.4.2 zip tar
-   2.4.1 zip tar
-   2.4.0 zip tar
-   2.3.4 zip tar
-   2.3.3 zip tar
-   2.3.2 zip tar
-   2.3.1 zip tar
-   2.3.0 zip tar
-   2.2.0 zip tar
-   2.1.3 zip tar
-   2.1.2 zip tar
-   2.1.1 zip tar
-   2.1.0 zip tar
-   2.0.0 zip tar
-   2.0.0-preview10 zip tar
-   2.0.0-preview9 zip tar
-   2.0.0-preview8 zip tar
-   2.0.0-preview7 zip tar
-   2.0.0-preview6 zip tar
-   2.0.0-preview5 zip tar
-   2.0.0-preview4 zip tar