# Chapter 51. The Jetty Plugin

This plugin is deprecated and will be removed in Gradle 4.0. Consider using the more feature-rich Gretty plugin instead.

The Jetty plugin extends the War plugin to add tasks which allow you to deploy your web application to a Jetty web container embedded in the build.

## 51.1. Usage

To use the Jetty plugin, include the following in your build script:

Example 51.1. Using the Jetty plugin

`build.gradle`

    apply plugin: 'jetty'

## 51.2. Tasks

The Jetty plugin defines the following tasks:

Table 51.1. Jetty plugin - tasks

Task name | Depends on | Type | Description
`jettyRun` | `compile` | `JettyRun` | Starts a Jetty instance and deploys the exploded web application to it.
`jettyRunWar` | `war` | `JettyRunWar` | Starts a Jetty instance and deploys the WAR to it.
`jettyStop` | - | `JettyStop` | Stops the Jetty instance.

Figure 51.1. Jetty plugin - tasks

## 51.3. Project layout

The Jetty plugin uses the same layout as the War plugin.

## 51.4. Dependency management

The Jetty plugin does not define any dependency configurations.

## 51.5. Convention properties

The Jetty plugin defines the following convention properties:

Table 51.2. Jetty plugin - properties

Property name | Type | Default value | Description
`contextPath` | `String` | WAR file base name | The application deployment location within the Jetty container.
`httpPort` | `Integer` | `8080` | The TCP port which Jetty should listen for HTTP requests on.
`stopPort` | `Integer` | `null` | The TCP port which Jetty should listen for admin requests on.
`stopKey` | `String` | `null` | The key to pass to Jetty when requesting it to stop.

These properties are provided by a `JettyPluginConvention` convention object.