leiningen 

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.

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

You can also set

:description
project description
:url
project's homepage

Creating a new project

lein new <project_name>