Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Working with Bundler
      • Rails Support
    • Python
      • Background Jobs in Python
      • Working with Django
    • Java
      • Working with Maven
      • Java Database Operations
      • Working with the Play Framework
      • Working with Spring Boot
      • Java Advanced Topics
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Deployment
  • Deployment Integrations
  • WAR Deployment

WAR Deployment

English — 日本語に切り替える

Last updated January 08, 2020

Table of Contents

  • Deployment with the Heroku Maven Plugin
  • Deployment with the Heroku CLI
  • Git Deployment with Webapp Runner
  • Deprecated Tools

Heroku supports the deployment of WAR files via Git deployment (which packages the WAR file remotely) and via the Heroku Maven plugin (which packages the WAR file locally). The default server for both methods is Tomcat 9, but the platform provides the flexibility to substitute any bootable or embeddable servlet container, such as Webapp Runner.

This article provides a general overview of the two WAR file deployment methods and discusses the tradeoffs between them.

Deployment with the Heroku Maven Plugin

Deploying a WAR file with the Heroku Maven plugin allows you to integrate the deployment process with your existing Maven process. The Heroku plugin uses the artifacts generate by your mvn package phase, and builds them into a Slug file that is uploaded to the Heroku servers.

In this way, the Heroku Maven plugin avoids the overhead of recompiling your project remotely. This is often the preferred approach when deploying from a CI server, which may already have built your WAR file and tested it.

Deployment with the Heroku CLI

The Heroku Java CLI Plugin deploys a local WAR file to Heroku and runs it with Tomcat Webapp-Runner. You can install or update the plugin with this command:

$ heroku plugins:install java

And as long as you have a Java runtime installed locally, you can deploy with this command:

$ heroku war:deploy <path_to_war_file> --app <app_name>

The CLI plugin uses the same underlying code as the Heroku Maven plugin, but without the Maven integration. As a result, it supports many of the same configuration options but with a different mechanism. You can learn how to customize this tool in Configuring WAR Deployment with the Heroku CLI.

Git Deployment with Webapp Runner

Deploying a WAR file by pushing to a Git repository is an easy way to get started with Heroku. It also has the advantage of ensuring Dev/Prod parity. However, the compile phase of Git deployment will execute your Maven goals, which makes it slower than other deployment methods.

For more information, see our article on Deploying Tomcat-based Java Web Applications with Webapp Runner. If you’re using Gradle, see our guide to Deploy WAR files with Gradle

Deprecated Tools

A number of older Heroku tools that were used to deploy WAR files may work, but are no longer being actively developed. They include:

  • Heroku Eclipse Plugin

  • Heroku Jenkins Plugin

While they may continue to work, it is strongly recommended that you upgrade to one of the other approaches described in this article.

See the Heroku DevCenter articles for more information on deploying from Eclipse, IntelliJ or a CI Server.

Keep reading

  • Deployment Integrations

Feedback

Log in to submit feedback.

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Podcasts
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences