I have to use an unmanaged SNAPSHOT dependency in my java/maven heroku app.
I do this using a project-local maven repository as desribed in this article.
Heroku c
Login to heroko by console, go to the git repository directory of your app, run the following commands and try to push to the heroku git repository again
$ heroku config:set MAVEN_CUSTOM_GOALS="clean package"
$ heroku config:set MAVEN_CUSTOM_OPTS="--update-snapshots -DskipTests=true"
Now, it will download the latest SNAPSHOT
from the repository before build.
Refer this heroku build pack for java for more details.
You can also configure a custom settings.xml
for your maven, refer this heroku documentation.
This doesn't answer the question directly, but if you're having the same issue with Clojure project (using Leiningen), there's a better way to handle this than purging cache with each build: use :update :always
property for the repository you're working with. (https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L91)
:repositories [["releases" {:url "http://blueant.com/archiva/internal"
;; How often should this repository be checked for
;; snapshot updates? (:daily, :always, or :never)
:update :always}]]
There's a branch of the java buildpack that clears maven cache. To use it, configure your app to use the cache_clear
branch:
heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-java.git#cache_clear
===Update===
There's a plugin that clears cache on any app. Install it and run the purge-cache command.
$ heroku plugins:install https://github.com/heroku/heroku-repo.git
$ heroku repo:purge_cache -a appname
I've written plugin with an alternate take: bundling the container + the war image into a git repository base image (for now, its either winstone and/or jetty) which is pushed to Heroku, thus maving easier to deploy (I think) :]
http://cedarhero.ingenieux.com.br/heroku-maven-plugin/