Skip to content


Subversion checkout URL

You can clone with
Download ZIP
heroku buildpack for Apache Ant
#3 Compare This branch is 46 commits ahead, 192 commits behind heroku:master.
Failed to load latest commit information.
bin testing issue #2
test testing issue #2
.project initial (untested) preparations for running Java on Heroku using Ant testing issue #2

Heroku buildpack: Java (with Apache Ant)

This is a Heroku buildpack for Java apps. It uses Apache Ant 1.9.3 to build your application and OpenJDK 1.6.0_27 (currently) to run it.


Example usage:

$ ls
Procfile    build.xml   libs        src

$ heroku create --stack cedar --buildpack

$ git push heroku master
-----> Heroku receiving push
-----> Fetching custom buildpack... done
-----> Java (using Apache Ant 1.9.3) app detected
-----> Installing Apache Ant 1.9.3.....done!
-----> executing /tmp/build_1i100c5e7xm9u/.buildpack/apache-ant-1.8.4/bin/ant -Duser.home=/tmp/build_1i100c5e7xm9u clean install
   Buildfile: /tmp/build_1i100c5e7xm9u/build.xml

        [echo] cleaning...

       [mkdir] Created dir: /tmp/build_1i100c5e7xm9u/target/classes

       [javac] Compiling 1 source file to /tmp/build_1i100c5e7xm9u/target/classes

         [jar] Building jar: /tmp/build_1i100c5e7xm9u/target/application.jar

        [echo] installing...

   Total time: 0 seconds
-----> Discovering process types
Procfile declares types -> web
-----> Compiled slug size is 5.6MB
-----> Launching... done, v5
http://<your-app-name> deployed to Heroku

The buildpack will detect your app as Java (using Apache Ant) if it has the file 'build.xml' in the root. It will use Apache Ant to execute the targets 'clean install' defined by your build.xml.

The Ant executable is unpacked inside your slug directory in '.buildpack' and is therefore also available for running the actual Java application too (I added its bin folder to the PATH).

Example Procfile:

web: ant run

Config Update

If you have been using this buildpack before, the upgrade from 1.9.x to 1.9.3 now requires a heroku config update.

Please issue:

heroku config:set ANT_HOME=/app/.buildpack/apache-ant-1.9.3
heroku config:set PATH=/usr/local/bin:/usr/bin:/bin:/app/.buildpack/apache-ant-1.9.3/bin

to make it work again...


To use a modification of 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 too.

Something went wrong with that request. Please try again.