我几乎在Heroku上部署了我的第一个Java Maven应用程序,但我需要一些帮助 . 我正在使用WAR部署部署我的应用程序:https://devcenter.heroku.com/articles/war-deployment . 我将context.xml文件分开,它不在WAR文件中 . 我真的知道如何以及在哪里放置它?

我这样做:

  • 创建一个应用程序并使用Heroku指出 git:remote -a app-name

  • 添加Tomcat webapp-runner: heroku config:set WEBAPP_RUNNER_OPTS="--enable-naming --context-xml=path/to/context.xml" - 其中path / to / context.xml是设计的context.xml的 real 路径

  • 然后进行部署: heroku war:deploy <path_to_war_file>

但是,根据文件,包括在这里: heroku war:deploy myapp.war --includes newrelic.jar:newrelic.xml

所以我在部署时会发出这样的命令: heroku war:deploy <path_to_war_file> --includes context.xml