heroku-buildpack-clojure

Heroku buildpack: Clojure

Note that you don't have to do anything special to use this buildpack
with Clojure apps on Heroku; it will be used by default for all
projects containing a project.clj file, though it may be an older
revision than current master.

The buildpack will detect your app as Clojure if it has aproject.clj file in the root. If you use theclojure-maven-plugin,the standard Java buildpack
should work instead. Leiningen 1.7.1 will be used by default, but if
you have :min-lein-version "2.0.0" in project.clj then Leiningen 2.x
will be used instead.

Configuration

By default your project is built by running lein deps under
Leiningen 1.x and lein compile :all under Leiningen 2.x. To
customize this, check in a bin/build script into your project and it
will be run instead of invoking lein directly.

If you are using Leiningen 2.x, it's highly recommended that you use
the :production profile in your Procfile and/or bin/build to avoid
having tests and development dependencies on your classpath in
production.

If you don't need to add anything to the :production profile then
you can leave it out and the one from opt/profiles.clj in the
buildpack will be used. If you do need to add something, it's
recommended you include :mirrors for faster dependency resolution
from S3 for Central:

Since Clojars currently mixes snapshots and releases it's currently
not appropriate to mirror to S3 unless you know for sure you're not
using any snapshots even transitively.

You should reduce memory consumption by using the trampoline task in
your Procfile. This will cause Leiningen to calculate the classpath
and code to run for your project, then exit and execute your project's
JVM:

web: lein with-profile offline,production trampoline run -m myapp.web

JDK Version

By default you will get OpenJDK 1.6. To use a different version, you
can commit a system.properties file to your app.

Hacking

To change this buildpack, fork it on GitHub. Push up changes to your
fork, then create a test app with --buildpack YOUR_GITHUB_URL and
push to it. If you already have an existing app you may useheroku config:add BUILDPACK_URL=YOUR_GITHUB_URL instead.

For example, you could adapt it to generate an uberjar at build time.

Open bin/compile in your editor, and replace the block labeled
"fetch deps with lein" with something like this: