Setup
Specify jar source in Procfile.
1
| web: java -Dserver.port=$PORT $JAVA_OPTS -jar target/demo-0.0.1-SNAPSHOT.jar
|
Deploy
Deployment automatically starts with Heroku CLI with the following command:
1
2
3
| git add .
git commit "message"
git push heroku master
|
Errors in initial build
Invalid target release
1
| [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project demo: Fatal error compiling: invalid target release: 17 -> [Help 1]
|
Solution
Add matching java version to force the version in system.properties in root.
1
| java.runtime.version=17
|
Success