Send to Kindle
home » snippets » clojure » leiningen

Leiningen uses fixed structure of project — in the root directory of the project you need to have the project.clj

The only necessary component of the definition is defproject — Clojure's macro, that is expanded into set of build instructions

Directory Structure - src - test - resources - lib - libraries are copied here by the lein deps command. - If you want to use library, that isn't stored in one of the Maven's repositories, then you can just copy this library into lib directory, and it will available to your project.

These directory names can be changed by defproject.

name of directory with project's source code (by default — src);
name of directory for resulting Java classes (by default — classes/);
name of directory with project's resources (by default — resources/);
name of directory with test's source code (by default — test/);
name of directory, where libraries are stored (by default — lib/).

You can also set

project description
project's homepage

Creating a new project

lein new <project_name>