如何将.war部署到heroku [英] How to deploy .war to heroku

查看:164
本文介绍了如何将.war部署到heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在eclipse上制作了一个动态Web项目,并以index.html开头。我已经测试过它,它在我的本地apache服务器上工作。我已经生成了战争文件。现在我想将war文件部署到heroku。我已经下载并安装了所有东西。我检查了互联网,并开始了解如何创建

pom.xml,一个Main类以开始执行,maven汇编程序jar文件。



作为初学者,我无法理解如何创建这些文件并将它们推送到heroku。有人能解释我吗?我不想创建一个新的heroku项目。

解决方案

有两种方法可以将战争部署到Heroku:


  • 使用webapp-runner(或类似的jetty-runner)
  • 使用toolbelt deploy:war命令
>

首选方法是使用webapp-runner,因为它允许更多的容器配置。以下是有关使用webapp-runner的文章。 webapp-runner是一个简单的Tomcat容器,用于运行你的war文件。一般来说,您可以将webapp-runner添加到您的 pom.xml 中,相应地设置您的 Procfile ,然后将其部署到Heroku中 git push
$ b

deploy:war 方法在这篇文章。它有点过时了,并没有给你太多的配置。


I have made a dynamic web project on eclipse that starts on front end with index.html . I have tested it and it works on my local apache server. I have generated the war file. Now I want to deploy the war file to heroku. I have downloaded and installed everything. I checked the internet and I came to know about creating

pom.xml , a Main class to start execution , maven assembler jar file.

As a beginner I am not able to understand how to create these files and push them to heroku. Can someone please explain me ? I dont want to create a new heroku project.

解决方案

There are two ways to deploy a war to Heroku:

  • Using the webapp-runner (or the similar jetty-runner)
  • Using the toolbelt deploy:war command

The preferred approach is using webapp-runner because it allows for more configuration of the container. Here is an article on using webapp-runner. The webapp-runner is a simple Tomcat container used to run your war file. In general, you add webapp-runner to your pom.xml, set your Procfile accordingly, and deploy to Heroku with git push.

The deploy:war approach is described in this article. It's somewhat outdated, and does not give you much in the way of configuration.

这篇关于如何将.war部署到heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆