Jump to content

Learning Clojure/Leiningen

From Wikibooks, open books for an open world
Previous page
Concurrent Programming
Learning Clojure Next page
Reader Macros
Leiningen

Leiningen is a build tool for Clojure based on Maven. It can do everything that Maven does, but it adds further support for Clojure and streamlines common Clojure tasks.

Like Maven, Leiningen favors convention over configuration, and thus automates many of the build, test and deployment steps without lots of complex configuration.

Getting started with Leiningen

[edit | edit source]

The official home page for Leiningen is at https://github.com/technomancy/leiningen. Like Maven, Leiningen can download and install dependencies as needed, so to install it all that is necessary is to download and run a small bootstrap script that will install all the additional modules as needed.

Installing on Linux

[edit | edit source]

Download the shell script from https://github.com/technomancy/leiningen/raw/stable/bin/lein. Put it somewhere in your path and make it executable. A convenient place to put it is in ~/bin, if that is on your $PATH. You should then be able to run lein commands:

$ lein version
Leiningen 1.4.1 on Java 1.6.0_20 OpenJDK Client VM

Installing on Windows

[edit | edit source]
  1. Download the Windows distribution from https://github.com/downloads/technomancy/leiningen/leiningen-1.4.1-win32.zip.
  2. Unzip it to a folder of your choice
  3. Modify your path to include the 'lein' directory