繁体   English   中英

将war文件部署到heroku,包括附加文件

[英]Deploy war file to heroku including additional files

我正在将一个war文件部署到heroku并希望在 slug 中包含其他properties文件,如下所述:

使用 Heroku CLI 配置 WAR 部署

$ heroku war:deploy application.war --app awesomeapp --jdk 14 --includes app1.properties

它成功部署了war文件,但在扩展应用程序的任何子文件夹中我都找不到app1.properties文件。 同时, war档案中的所有其他文件都在他们的位置,额外的tomcat war-tracker文件,仅此而已。 我尝试添加一些jar文件,结果相同:

$ heroku war:deploy application.war --app awesomeapp --jdk 14 --includes app1.properties:some-lib.jar

问: heroku 在哪里包含附加文件? 如何访问那里?

这是heroku-cli的 output :

Uploading application.war
-----> Packaging application...
       - app: awesomeapp
       - including: app1.properties
       - including: some-lib.jar
       - including: webapp-runner.jar
       - including: application.war
-----> Creating build...
       - file: slug.tgz
       - size: 30MB
-----> Uploading build...
       - success
-----> Deploying...
remote:
remote: -----> heroku-deploy app detected
remote: -----> Installing JDK 14... done
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 96.9M
remote: -----> Launching...
remote:        Released v14
remote:        https://awesomeapp.herokuapp.com/ deployed to Heroku
remote:
-----> Done

这些文件将添加到您的 Heroku 应用程序的根目录中,并且不会放入扩展的应用程序目录中。

您可以通过运行heroku run "cat app1.properties"来验证您的文件是否存在于 Dynos 中。 如果您想自己探索文件系统, heroku run bash可以让您深入研究它。

编辑:如果您需要文件的路径,您可以使用

String path = System.getProperty("user.home") + File.separator + "app1.properties";

暂无
暂无

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

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