# JettyRun

API Documentation: | `JettyRun`

Deploys an exploded web application to an embedded Jetty web container. Does not require that the web application be assembled into a war, saving time during the development cycle.

Once started, the web container can be configured to run continuously, scanning for changes in the project and automatically performing a hot redeploy when necessary. This allows the developer to concentrate on coding changes to the project using their IDE of choice and have those changes immediately and transparently reflected in the running web container, eliminating development time that is wasted on rebuilding, reassembling and redeploying.

### Properties

Property | Description
`additionalRuntimeJars` | The classpath to make available to the web application.
`classpath` | The classpath for the web application.
`contextPath` | The context path to use to deploy the web application.
`daemon` | Specifies whether the Jetty server should run in the background. When `true`, this task completes as soon as the server has started. When `false`, this task blocks until the Jetty server is stopped.
`httpPort` | The TCP port for Jetty to listen on for incoming HTTP requests.
`jettyConfig` | The jetty configuration file to use. When `null`, no configuration file is used.
`reload` | The reload mode, which is either `"automatic"` or `"manual"`.
`scanIntervalSeconds` | The interval in seconds between scanning the web app for file changes. If file changes are detected, the web app is reloaded. Only relevant if `reload` is set to `"automatic"`. Defaults to `0`, which disables automatic reloading.
`stopKey` | The key to use to stop Jetty.
`stopPort` | The TCP port for Jetty to listen on for stop requests.
`webAppSourceDirectory` | The directory containing the web application source files.
`webXml` | The `web.xml` file to use. When `null`, no `web.xml` file is used.

### Property details

#### ``Iterable`<`File`>` `additionalRuntimeJars`

The classpath to make available to the web application.

Default with the `jetty` plugin:
  `[]`

#### `FileCollection` `classpath`

The classpath for the web application.

Default with `jetty` plugin:
  `project.sourceSets.main.runtimeClasspath`

#### `String` `contextPath`

The context path to use to deploy the web application.

Default with the `jetty` plugin:
  `project.war.baseName`

#### `boolean` `daemon`

Specifies whether the Jetty server should run in the background. When `true`, this task completes as soon as the server has started. When `false`, this task blocks until the Jetty server is stopped.

Default with the `jetty` plugin:
  `false`

#### `Integer` `httpPort`

The TCP port for Jetty to listen on for incoming HTTP requests.

Default with the `jetty` plugin:
  `project.httpPort`

#### `File` `jettyConfig`

The jetty configuration file to use. When `null`, no configuration file is used.

Default with the `jetty` plugin:
  `null`

#### `String` `reload`

The reload mode, which is either `"automatic"` or `"manual"`.

In automatic mode, the web app is scanned for file changes every n seconds, where n is determined by the `scanIntervalSeconds` property. (Note that `scanIntervalSeconds` defaults to `0`, which disables automatic reloading.) If files changes are detected, the web app is reloaded.

In manual mode, the web app is reloaded whenever the Enter key is pressed.

Default with the `jetty` plugin:
  `"automatic"`

#### `int` `scanIntervalSeconds`

The interval in seconds between scanning the web app for file changes. If file changes are detected, the web app is reloaded. Only relevant if `reload` is set to `"automatic"`. Defaults to `0`, which disables automatic reloading.

Default with the `jetty` plugin:
  `0`

#### `String` `stopKey`

The key to use to stop Jetty.

Default with the `jetty` plugin:
  `project.stopKey`

#### `Integer` `stopPort`

The TCP port for Jetty to listen on for stop requests.

Default with the `jetty` plugin:
  `project.stopPort`

#### `File` `webAppSourceDirectory`

The directory containing the web application source files.

Default with `jetty` plugin:
  `project.webAppDir`

#### `File` `webXml`

The `web.xml` file to use. When `null`, no `web.xml` file is used.

Default with `jetty` plugin:
  `project.war.webXml`, if not null, or ``${project.webAppDir}`/WEB-INF/web.xml`

### Script blocks

No script blocks

### Methods

No methods