6

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

messivanio
  • 2,263
  • 18
  • 24
user1160126
  • 195
  • 3
  • 4
  • 12

4 Answers4

15
  1. Create war file in Maven. You can do this by referring here
  2. Install the Heroku Toolbelt from here
  3. 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.
  4. Now, to install the heroku-deploy plugin, enter the code:
    heroku plugins:install heroku-cli-deploy
    
  5. Now deploy the war file to the heroku server by this code:
    heroku deploy:war --war <path_to_war_file> --app <app_name>
    
  6. If you are in an application directory, the --app parameter can be omitted:
    heroku deploy:war --war <path_to_war_file>
    

Your App will be successfully deployed to the heroku server.

Vamsee
  • 183
  • 1
  • 8
  • This helps me a lot. I was planning on hosting JIRA on a heroku server, the --app option is what made it a bit clearer for me how to deploy the JIRA war file on a heroku app. Although I'm a bit unclear on how to create a new app without an actual working source code base. – thorne51 Mar 17 '15 at 21:41
5

It's all well explained here :

https://devcenter.heroku.com/articles/java

Felix L
  • 246
  • 1
  • 3
4

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

Hai Nguyen
  • 1,675
  • 19
  • 14
0

This url shows exactly how to deploy a war file on heroku:

https://github.com/heroku/heroku-deploy

Angad Singh
  • 1,032
  • 1
  • 17
  • 36