Shopping list for setting up a Java EE Web App to be deployed on Heroku.
Assuming Maven, Java 11, Tomcat 9 as web server.
pom.xml: execution
Add to the build - plugins - plugin for maven-dependency-plugin, in the executions
<execution> <phase>package</phase> <goals> <goal>copy</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>com.heroku</groupId> <artifactId>webapp-runner</artifactId> <version>9.0.41.0</version> <destFileName>webapp-runner.jar</destFileName> </artifactItem> </artifactItems> </configuration> </execution>
The element "version" is the Tomcat version we want to use
System properties
Root level, the system.properties should specify the Java version
java.runtime.version=11
Procfile
A one-liner, I split it here to improve readability
web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT target/*.war