This is the official Heroku buildpack for apps that use Leiningen as their build tool. It's primarily used to build Clojure applications.
If you're using a different JVM build tool, use the appropriate buildpack:
- Java buildpack for Maven projects
- Gradle buildpack for Gradle projects
- Scala buildpack for sbt projects
This buildpack officially supports Leiningen 2.x. Leiningen 1.x is no longer supported.
See the Getting Started with Clojure on Heroku tutorial.
Your app requires a project.clj file in the root directory with :min-lein-version "2.0.0" or higher. It's recommended to also configure :uberjar-name in your project.clj.
Specify an OpenJDK version by creating a system.properties file in the root of your project directory and setting the java.runtime.version property. See the Java Support article for available versions and configuration instructions.
The buildpack uses Leiningen 2.12.0 by default for projects that specify :min-lein-version "2.0.0" or higher in their project.clj.
To use a specific Leiningen version, you can include a bin/lein script in your repository. The buildpack will detect and use this script instead of the default Leiningen installation.
Configure the buildpack by setting environment variables:
| Environment Variable | Description | Default |
|---|---|---|
LEIN_BUILD_TASK |
Leiningen task to execute | uberjar (if :uberjar-name is set) or with-profile production compile :all |
LEIN_INCLUDE_IN_SLUG |
Include Leiningen in the slug for runtime use | no |
CLOJURE_CLI_VERSION |
Clojure CLI tools version | 1.12.4.1597 |
You can also override the default build behavior by including a bin/build script in your repository. The buildpack will execute this script instead of the default build command.
For more information about using Clojure on Heroku, see the Clojure Support documentation on Dev Center.
