explaingit

technomancy/leiningen

7,308ClojureAudience · developerComplexity · 2/5Setup · easy

TLDR

The standard build and project management tool for Clojure, handles dependencies, testing, packaging, and publishing with a single script you download and run. Java must already be installed.

Mindmap

mindmap
  root((Leiningen))
    What it does
      Manage dependencies
      Run tests
      Package project
      Start REPL
    Config
      project.clj
      Profiles
      Plugin ecosystem
    Tech Stack
      Clojure
      Java JVM
    Audience
      Clojure developers
      JVM engineers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Create and manage a new Clojure project with all dependencies downloaded automatically from a single project.clj config file.

USE CASE 2

Start an interactive Clojure REPL with all project dependencies available for live experimentation.

USE CASE 3

Package a Clojure project as a standalone JAR and publish it to Clojars or Maven Central for others to use.

USE CASE 4

Extend your build workflow with community plugins that add tasks beyond the built-in core.

Tech stack

ClojureJavaJVM

Getting it running

Difficulty · easy Time to first run · 30min

Requires Java to be installed, Leiningen itself is a single script that downloads everything else on first run. Canonical repo has moved to Codeberg.

In plain English

Leiningen is a build and project management tool for Clojure, a programming language that runs on the Java platform. It handles the routine tasks involved in developing a Clojure project: creating the initial folder structure for a new project, downloading and managing library dependencies, running tests, starting an interactive coding session, packaging the project for distribution, and publishing it to public repositories for others to use. The name comes from a 1938 short story, "Leiningen Versus the Ants," in which a plantation owner holds off a massive ant swarm through sheer determination. The project uses this as a playful nod to the frustration that build tooling can cause. Installation is intentionally minimal. You download a single script file called lein, place it somewhere your system can find it, make it executable, and run it. Leiningen downloads everything else it needs on that first run. Java must already be installed on the machine. Projects are configured through a file called project.clj in the project's root folder. This file lists the project name, version, description, and any external libraries the project depends on. Leiningen reads this file to know what to download and how to build things. Profiles let you vary configuration between environments, for example having different settings for development versus testing. The tool supports plugins that extend its list of available tasks. A large community ecosystem of plugins covers additional use cases beyond what ships in the core tool. Note: the canonical home of this repository has moved to Codeberg. The GitHub version is a temporary mirror. If you use Leiningen, update your bookmarks and links to point to the Codeberg location.

Copy-paste prompts

Prompt 1
I'm starting a new Clojure project with Leiningen. Show me a complete project.clj file with common dependencies and explain each section.
Prompt 2
How do I use Leiningen profiles to have different dependencies and JVM options for development versus test versus production?
Prompt 3
Show me how to write a Leiningen plugin that adds a custom lein task any project can use.
Prompt 4
I want to run my Clojure test suite with Leiningen and generate a test coverage report. What plugins and project.clj config do I need?
Open on GitHub → Explain another repo

← technomancy on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.