For a long time, Leiningen was the Clojure project automation tool almost everyone used. Clojure itself did not come with a tool for managing dependencies – you had to use Leiningen, Maven, or Boot, or download the dependencies yourself and construct the classpath by hand.
This changed when Clojure 1.9 was released in 2017. It included the new
clojure command-line tool that supported the
deps.edn file for declaring
dependencies. Many people started to use the new tool instead of
Leiningen is straightforward to use and it has a good set of features and a nice
plugin ecosystem. However, it is a heavy tool if all you want to do is to run
some Clojure code.
deps.edn was created to solve this problem: it offers a
lightweight way to run Clojure code that uses external libraries.
I think it’s great: in addition to being nimbler than Leiningen, the dependency information is now data and it supports git dependencies.
It is not a replacement for Leiningen, however. It is not, and it was never
meant to be, a full-fledged project automation tool. I’ve used it quite a bit
and I find myself missing many of nice features of Leiningen. In theory you
could use Leiningen and
deps.edn together with lein-tools-deps but in
practice it has turned out to be awkward.
Here are a few things that I’m missing from Leiningen:
lein newfor setting up a new project
lein replfor starting a featureful, nREPL-enabled REPL
lein ubejarfor building jars with dependencies included - essential part of many deployment workflows
lein deploy, and
lein releasefor publishing the project to a Maven repo such as Clojars
The community has built versions of all of these for
However, you have to set each of them up separately and they do not form a coherent whole.
What I would love to see is a new tool – Leiningen 3.0, if you will – that would
resolve this tension. There must be a way to build full-featured, user-friendly
project automation tool on top of
I’d like to see is something with simple setup, with convention over configuration. Clojure is all about configuration and making things your own, but Leiningen’s strength comes from its good defaults. It is a very configurable tool but a lot of people have been happy with the default settings. That makes it easy to jump between projects, too.