heroku/heroku-buildpack-java — pull request #5 by jeanlaurent (2012-04-24 21:45:58+00:00)
Title: Add "heroku" in build command line to enable easy profile activation

I just added -Dheroku to the maven command line to enable easy detection of heroku running the build command.

This allows build to detect wether the build is run through heroku or not, with conditional profile activation like this :

heroku

heroku

...

Each & every application pom.xml will run with no changes, but some who wants to benefit from it, can, where before we should rely on ugly hacks (like file detection) to know wether or not the build is run through heroku.
This is useful since it speed up the build process when run outside of heroku, (most of the time the local copy dependencies is not useful during a non-heroku build, which is probably more common).

full runnning example to test the build pack :

heroku create --stack cedar --buildpack http://github.com/jeanlaurent/heroku-buildpack-java.git
with a pom.xml slighty changed from the heroku java tutorial to (we just wrapped the maven dep copy within a profile) :

heroku

heroku

maven-dependency-plugin

copy-dependencies
package

copy-dependencies

true
compile
runtime
test
${project.build.directory}/lib

running mvn clean install outside heroku is speedy as the copy dep is skipped, and it still is activated when run from heroku.