简体   繁体   English

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

[英]Deploy war file to heroku including additional files

I am deploying a war file to heroku and want to include additional properties file to the slug as described here:我正在将一个war文件部署到heroku并希望在 slug 中包含其他properties文件,如下所述:

Configuring WAR Deployment with the Heroku CLI 使用 Heroku CLI 配置 WAR 部署

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

It deploys war file successfully, but in any subfolder of the expanded application I can't find app1.properties file.它成功部署了war文件,但在扩展应用程序的任何子文件夹中我都找不到app1.properties文件。 At the same time all other files from war archive are on their places, additional tomcat war-tracker file, and nothing more.同时, war档案中的所有其他文件都在他们的位置,额外的tomcat war-tracker文件,仅此而已。 I tried to add some jar file with same result:我尝试添加一些jar文件,结果相同:

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

Question: Where does heroku include additional files?问: heroku 在哪里包含附加文件? How to get access there?如何访问那里?

This is the output of the heroku-cli :这是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

Those files will be added to the root of your Heroku application and won't be put into the expanded application directory.这些文件将添加到您的 Heroku 应用程序的根目录中,并且不会放入扩展的应用程序目录中。

You can verify your file is present in your Dynos by running heroku run "cat app1.properties" .您可以通过运行heroku run "cat app1.properties"来验证您的文件是否存在于 Dynos 中。 If you want to explore the file system yourself, heroku run bash allows you to delve though it.如果您想自己探索文件系统, heroku run bash可以让您深入研究它。

Edit: If you need a path to the file, you can construct one using编辑:如果您需要文件的路径,您可以使用

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

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

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