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:
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.
heroku plugins:install heroku-cli-deploy
heroku war:deploy <path_to_war_file--app <app_name>
For more information please visit: https://devcenter.heroku.com/articles/war-deployment
I used successfully:
I added to Procfile
buildpacks:clear
war:deploy target/routeplanner.war
and after
git push
Build and deploy completed. In log:
app[api]: Deploy a68256e8
app[api]: Build succeeded
But create the project URL returns Error: "in the application and your page could not be served"
In log: heroku[router]: at=error code=H14 desc="No web processes running"
But why do I have to request these commands again from console to reanimate application work?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.