'Permission denied heroku error in jar dependency
I'm trying to deploy a java web app to heroku and I'm getting permission denied error in one of my dependencies which is "aether-api-1.7.jar". I already add a realease command to prevent this error but it kept.
Procfile:
release: chmod u+x target/dependency/aether-api-1.7.jar
web: java -Dserver.port=$PORT -cp target/classes;target/dependency/* Server
Heroku logs:
2019-11-17T06:10:24.922962+00:00 app[web.1]: See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
2019-11-17T06:10:24.934033+00:00 app[web.1]: bash: target/dependency/aether-api-1.7.jar: Permission denied
2019-11-17T06:10:24.987470+00:00 heroku[web.1]: Process exited with status 126
Solution 1:[1]
Change the ; in your Procfile to :. The ; is causing the rest of the command to be treated as a different command.
The release command can't modify your files.
Solution 2:[2]
Try to use it in Procfile: web: java -Dserver.port=$PORT $JAVA_OPTS -jar ./build/libs/your-file-0.0.1.jar
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | codefinger |
| Solution 2 |
