Home

lein

Leiningen, commonly invoked as lein, is a build automation and project management tool for Clojure. It orchestrates compilation, testing, dependency resolution, packaging, and running applications. By centralizing configuration and tooling, lein simplifies project setup and repeatable workflows. It relies on Maven-compatible repositories such as Maven Central and Clojars to fetch libraries.

Projects are described in a project.clj file, written in Clojure data structures. The file typically includes

Leiningen provides a set of built-in tasks for common operations: deps fetches dependencies; compile compiles source

Leiningen also supports scaffolding and plugins. The lein new command creates new projects from templates (such

As an established tool, Leiningen remains widely used in Clojure projects despite the emergence of alternatives

the
project
name
and
version,
description,
license,
source
and
test
paths,
dependencies,
and
plugins.
The
defproject
form
defines
the
project,
while
dependencies
specify
library
coordinates
and
versions,
enabling
transitive
resolution.
files;
test
runs
tests;
run
launches
a
main
class
or
namespace;
jar
packages
a
JAR;
uberjar
builds
a
standalone
executable
JAR;
clean
removes
build
artifacts.
The
repl
task
starts
an
interactive
programming
session.
Tasks
can
be
composed
with
do
to
run
multiple
steps
in
sequence,
for
example
lein
do
clean,
deps,
compile,
test.
as
app
or
plugin).
The
plugin
system
allows
extending
functionality,
for
example
integrating
with
web
servers,
packaging
types,
or
code
quality
tools.
Leiningen
uses
a
local
cache
and
resolves
dependencies
from
remote
repositories,
storing
artifacts
in
the
local
Maven
repository.
such
as
the
Clojure
CLI
tools
and
the
deps.edn
workflow.
It
emphasizes
a
mature
plugin
ecosystem,
reproducible
builds,
and
a
familiar
project-centric
workflow
that
many
teams
continue
to
rely
on.