我正在尝试在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的项目?
答案 0 :(得分:1)
您将要使用JVM buildpack,您可以通过在应用程序而不是heroku/jvm
buildpack上设置heroku/java
buildpack来执行此操作。
例如,您可以运行:
$ heroku buildpacks:set heroku/jvm
或者在Heroku Dashboard的应用程序的“设置”标签中进行设置