将war文件部署到heroku中,包括其他文件

编程入门 行业动态 更新时间:2024-10-27 19:29:27
本文介绍了将war文件部署到heroku中,包括其他文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

I am deploying a war file to heroku and want to include additional properties file to the slug as described here:

使用Heroku CLI配置WAR部署

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

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

It deploys war file successfully, but in any subfolder of the expanded application I can't find app1.properties file. At the same time all other files from war archive are on their places, additional tomcat war-tracker file, and nothing more. I tried to add some jar file with same result:

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

问题:heroku在哪里包括其他文件?

Question: Where does heroku include additional files? How to get access there?

这是 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: awesomeapp.herokuapp/ deployed to Heroku remote: -----> Done

推荐答案

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

Those files will be added to the root of your Heroku application and won't be put into the expanded application directory.

您可以通过运行 heroku run来验证您的Dynos中是否存在文件。 cat app1.properties 。如果要自己浏览文件系统,可以使用 heroku run bash 进行深入研究。

You can verify your file is present in your Dynos by running heroku run "cat app1.properties". If you want to explore the file system yourself, heroku run bash allows you to delve though it.

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

If you need a path to the file, you can construct one using

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

更多推荐

将war文件部署到heroku中,包括其他文件

本文发布于:2023-10-28 02:11:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1535202.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   war   heroku

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!