Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Steps needed to deploy war on Heroku

Tags:

java

heroku

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

like image 462
user1160126 Avatar asked Mar 29 '12 10:03

user1160126


People also ask

How do I deploy a WAR file?

Perhaps the simplest way to deploy a WAR file to Tomcat is to copy the file to Tomcat's webapps directory. Copy and paste WAR files into Tomcat's webapps directory to deploy them. Tomcat monitors this webapps directory for changes, and if it finds a new file there, it will attempt to deploy it.

How do I run a WAR package?

Run the WAR fileOpen up a terminal/command prompt window to the download directory. Run the command java -jar jenkins. war . Browse to http://localhost:8080 and wait until the Unlock Jenkins page appears.

Can you deploy on Heroku?

Heroku lets you deploy, run and manage applications written in Ruby, Node. js, Java, Python, Clojure, Scala, Go and PHP.

How do I run heroku deployed app?

Run the npm install command in your local app directory to install the dependencies that you declared in your package. json file. Start your app locally using the heroku local command, which is installed as part of the Heroku CLI. Your app should now be running on http://localhost:5000/.


1 Answers

  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.

like image 76
Vamsee Avatar answered Oct 03 '22 05:10

Vamsee