我正在尝试在Heroku上部署一个可执行的Spring Boot jar .
我告诉Heroku从只包含这些文件的github存储库进行部署:
.
├── Procfile
└── current/
└── <my application>.jar
我的 Procfile
看起来像这样:
web: java $JAVA_OPTS -Dserver.port=$PORT -jar current/*.jar
这是我尝试部署时在Heroku构建日志中遇到的错误:
-----> Failed to detect app matching no buildpack
More info: https://devcenter.heroku.com/articles/buildpacks#detection-
failure
! Push failed
如果我在github中查看 heroku/java
构建包项目,我可以看到有一个名为 detect
的脚本检查是否存在 pom.xml
文件:
https://github.com/heroku/heroku-buildpack-java/blob/master/bin/detect
我相信我的项目没有被部署,因为我在根目录中没有pom .
是否可以只部署一个只包含可执行jar和Procfile的项目?
1 回答
您将需要使用JVM buildpack,您可以通过在应用程序上设置
heroku/jvm
buildpack而不是heroku/java
buildpack来执行此操作 .例如,您可以运行:
或者在应用程序的Heroku Dashboard的Settings选项卡中设置它