Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Gradle Jetty plug-in


May 25, 2021 Gradle


Table of contents


Jetty plug-in

The Jetty plug-in inherits from the War plug-in and adds tasks that allow you to deploy your web application to a Jetty web embedded container at build time.

Usage

To use Jetty's plug-in, include the following statement in the build script:

Use the Jetty plug-in

build.gradle

apply plugin: 'jetty'  

Task

The Jetty plug-in defines the following tasks:

Table 28.1. Jetty plug-in - task

The name of the task Depends on Type Describe
jettyRun compile jettyRun Launch the Jetty instance and deploy the exploded web application.
jettyRunWar war jettyRunWar Launch the Jetty instance and deploy the WAR package.
jettyStop - jettyStop Stop the Jetty instance.

Figure 28.1. Jetty plug-in - tasks

Gradle Jetty plug-in

The project layout

The Jetty plug-in uses the same layout as the And War plug-in.

Rely on management

The Jetty plug-in does not define any dependency configuration.

Convention properties

The Jetty plug-in defines the following convention properties:

Table 28.2. Jetty plug-in - property

The name of the property Type The default Describe
contextPath String The base name of the WAR file The location where the application is deployed in the Jetty container.
httpPort Integer 8080 Jetty listens to the TCP port for HTTP requests.
stopPort Integer null Jetty listens to the TCP port requested by admin.
stopKey String null Key passed to Jetty when a request to stop is required.

These properties are provided by a JettyPluginConvention convention object.