Skip to content

Instantly share code, notes, and snippets.

@anandbn
Created April 13, 2012 21:55
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anandbn/a8c62301591a11b4c6e9 to your computer and use it in GitHub Desktop.
Save anandbn/a8c62301591a11b4c6e9 to your computer and use it in GitHub Desktop.
WAR Deployment - How to get started

Getting started with WAR deployment on Heroku

Pre requisites

You will require the following:

Getting started

1. Install the heroku-deploy CLI plugin

Use the following command to install the heroku-deploy plugin:

### Git URL needs to be finalized
heroku plugins:install https://github.com/heroku/heroku-deploy

Note: If you have a previous version of Heroku client, please ensure you update to the latest version. You should have ver 2.24.0 of the Heroku command line. To verify your version, type the following command:

 $ heroku version
 2.24.0

or

 C:\>heroku version
 2.24.0

2. Create a Heroku application

Use the following command to create a new application on Heroku

heroku create --stack cedar [app_name]

3. Create a WAR file

You can use any method to generate a WAR file. You can use maven,ant or simply export your application from your IDE as a WAR file.

The only requirement is that the WAR file is a standard Java web application and adheres to the standard web application structure and conventions.

4. Deploy your WAR

In order to deploy your WAR use the following command:

heroku deploy:war --war <absolute_path_to_war_file> --app <app_name> 

Note: app_name should be in all lowercase.

If you are in an application directory, you can use the following command instead::

heroku deploy:war --war <absolute_path_to_war_file>

5. View your app on Heroku

Use the following command to open the application on the browser:

heroku open 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment