How can I deploy a java web app to heroku? How can I deploy a java web app to heroku? docker docker

How can I deploy a java web app to heroku?


I ended up fixing this by using webapp-runner to deploy my app. It runs the webapp-runner jar which can run your .war files. This required adding the heroku-maven-plugin and maven-dependency-plugin.

I could then add a Procfile: web: java -jar target/dependency/webapp-runner.jar target/*.war --port $PORT

and use the Heroku CLI to add the app using git. The link with webapp-runner is a guide to deploying tomcat java apps with webapp-runner.