I have a spring boot gradle app which I could run successfully on my PC by doing:
heroku local
It can also deploy on heroku successfully wh
You don't need to modify your stage task for that.
In your gradle.build file, make sure to give a name to your built artifact like this.
jar {
baseName = 'app'
version = '0.0.1'
}
With that been done, and the following in Procfile, it should just run fine.
web: java -Dserver.port=$PORT $JAVA_OPTS -jar build/libs/app-0.0.1.jar
I found that if name is not explicitly defined, heroku seems to name the artifact something like build-{buildNumber}.jar and no wonder it will never find the app.jar.
Also, if not set already, the build pack needs to be set.
heroku config:set GRADLE_TASK="build"