heroku-buildpack-clojure

by heroku

README.md

clojure

Heroku Buildpack: Clojure (Leiningen) CI

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:

Table of Contents

Supported Leiningen Versions

This buildpack officially supports Leiningen 2.x. Leiningen 1.x is no longer supported.

Getting Started

See the Getting Started with Clojure on Heroku tutorial.

Application Requirements

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.

Configuration

OpenJDK Version

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.

Leiningen Version

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.

Buildpack Configuration

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.

Documentation

For more information about using Clojure on Heroku, see the Clojure Support documentation on Dev Center.

CLI Installation

For new applications:

$ heroku create --buildpack https://github.com/heroku/heroku-buildpack-clojure.git

For existing applications:

$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-clojure.git -a YOUR_APP_NAME