【问题标题】:Deploy war file to heroku including additional files将war文件部署到heroku,包括附加文件
【发布时间】:2020-08-15 07:59:23
【问题描述】:

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

Configuring WAR Deployment with the Heroku CLI

$ 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的输出:

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

【问题讨论】:

    标签: java heroku deployment war


    【解决方案1】:

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

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

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

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

    【讨论】:

      猜你喜欢
      • 2017-01-27
      • 1970-01-01
      • 2013-08-30
      • 2019-10-27
      • 2021-07-12
      • 2016-08-23
      • 2012-05-08
      • 2018-07-25
      • 1970-01-01
      相关资源
      最近更新 更多