问题
I have spring source tool with Maven. And I have one Java project which I want to deploy on Heroku. Can anybody tell me steps to deploy on Heroku?
Many Thanks
回答1:
- Create war file in Maven. You can do this by referring here
- Install the Heroku Toolbelt from here
- open the command prompt (for Windows) and type
$heroku login
it will prompt to enter user name and password. Enter the credentials of your heroku account. - Now, to install the heroku-deploy plugin, enter the code:
$ heroku plugins:install heroku-cli-deploy - Now deploy the war file to the heroku server by this code:
$ heroku deploy:war --war <path_to_war_file> --app <app_name> - If you are in an application directory, the
--appparameter can be omitted:$ heroku deploy:war --war <path_to_war_file>
Your App will be successfully deployed to the heroku server.
回答2:
It's all well explained here :
https://devcenter.heroku.com/articles/java
回答3:
How to deploy war file to Heroku
- Register Heroku account
- Install heroku-cli
- Install JDK if needed
- Install heroku-cli-deploy plugin using command:
heroku plugins:install heroku-cli-deploy - Login to heroku in command line:
heroku login - Create app using command:
heroku apps:create <app_name> - Deploy war file using this command:
heroku war:deploy <path_to_war_file> --app <app_name> - Open app using command:
heroku open -a <app_name>
Reference
- Heroku Deploy War/Jar
回答4:
This url shows exactly how to deploy a war file on heroku:
https://github.com/heroku/heroku-deploy
来源:https://stackoverflow.com/questions/9923486/steps-needed-to-deploy-war-on-heroku