简体   繁体   English

将可运行的Spring Boot Jar部署到Heroku

[英]Deploy runnable spring boot jar to Heroku

I'm trying to get an executable Spring Boot jar to deploy on Heroku. 我正在尝试让可执行的Spring Boot jar部署在Heroku上。

I have told Heroku to deploy from a github repository that contains only these files: 我已经告诉Heroku从仅包含以下文件的github存储库中进行部署:

.
├── Procfile
└── current/
    └── <my application>.jar

My Procfile looks like this: 我的Procfile看起来像这样:

web: java $JAVA_OPTS -Dserver.port=$PORT -jar current/*.jar

This is the error I get in the Heroku build log when I try to deploy: 这是我尝试部署时在Heroku构建日志中遇到的错误:

-----> Failed to detect app matching no buildpack
       More info: https://devcenter.heroku.com/articles/buildpacks#detection-
failure
 !     Push failed

If I look at the heroku/java build pack project in github, I can see that there's a script called detect that checks for the existence of a pom.xml file: 如果我查看github中的heroku/java build pack项目,可以看到有一个名为detect的脚本,用于检查pom.xml文件的存在:

https://github.com/heroku/heroku-buildpack-java/blob/master/bin/detect https://github.com/heroku/heroku-buildpack-java/blob/master/bin/detect

I believe my project isn't being deployed because I don't have a pom in the root directory. 我相信我的项目没有被部署,因为我的根目录中没有pom。

Is it possible to just deploy a project that contains only an executable jar and a Procfile? 是否可以仅部署仅包含可执行jar和Procfile的项目?

You'll want to use the JVM buildpack instead, which you can do by setting the heroku/jvm buildpack on the app instead of the heroku/java buildpack. 您将改为使用JVM buildpack,可以通过在应用程序上设置heroku/jvm buildpack而不是heroku/java buildpack来完成。

For example, you can run: 例如,您可以运行:

$ heroku buildpacks:set heroku/jvm

Or set it in the Heroku Dashboard's Settings tab for the app 或在应用程序的Heroku仪表板的“设置”标签中进行设置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM