Heroku Maven github deploy



我在 heroku 部署中遇到了一些问题

2020-05-29T00:59:40.015516+00:00 app[web.1]: Error: Unable to access jarfile target/barbershop-0.0.1-SNAPSHOT.jar
2020-05-29T00:59:40.082046+00:00 heroku[web.1]: Process exited with status 1
2020-05-29T00:59:40.135944+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-29T00:59:44.102979+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=powerful-taiga-48681.herokuapp.com request_id=759de18f-db81-47ca-8108-452945494b3d fwd="179.180.253.131" dyno= connect= service= status=503 bytes= protocol=https

错误:无法访问 jarfile target/barbershop-0.0.1-SNAPSHOT

.jar

您是否检查过target/barbershop-0.0.1-SNAPSHOT.jar是否在您的文件系统中?

我正在通过 github 部署,但是当部署完成时不会生成我的 jar 文件,所以我需要创建一个 sh 文件来为我管理它,如下所示:

start.sh

./mvnw clean package
./mvnw build
./mvnw package
java -Dserver.port=$PORT -jar target/barbershop-0.0.1-SNAPSHOT.jar

Procfile

web: chmod a+x ./mvnw; chmod a+x ./start.sh; ./start.sh

最新更新