Base class for all tasks which deploy a web application to an embedded Tomcat web container.
| Modifiers | Name | Description |
|---|---|---|
static java.lang.Object |
CONFIG_FILE |
| Type | Name and description |
|---|---|
java.lang.String |
URIEncodingSpecifies the character encoding used to decode the URI bytes by the HTTP Connector. |
java.lang.Iterable<java.io.File> |
additionalRuntimeResourcesDefines additional runtime JARs or directories that are not provided by the web application. |
java.lang.Integer |
ajpPortThe TCP port which Tomcat should listen for AJP requests. |
java.lang.String |
ajpProtocolThe AJP protocol handler class name to be used. |
java.lang.String |
clientAuthThe clientAuth setting to use, values may be: "true", "false" or "want". |
java.io.File |
configFileThe path to the Tomcat context XML file. |
java.lang.String |
contextPathThe URL context path under which the web application will be registered. |
java.lang.Boolean |
daemonSpecifies whether the Tomcat server should run in the background. |
java.lang.Boolean |
enableSSLDetermines whether the HTTPS connector should be created. |
java.lang.Integer |
httpPortThe TCP port which Tomcat should listen for HTTP requests. |
java.lang.String |
httpProtocolThe HTTP protocol handler class name to be used. |
java.lang.Integer |
httpsPortThe TCP port which Tomcat should listen for HTTPS requests. |
java.lang.String |
httpsProtocolThe HTTPS protocol handler class name to be used. |
java.io.File |
keystoreFileThe keystore file to use for SSL, if enabled (by default, a keystore will be generated). |
java.lang.String |
keystorePassThe keystore password to use for SSL, if enabled. |
java.io.File |
outputFileThe file to write Tomcat log messages to. |
java.lang.Boolean |
preserveSSLKeyDoesn't override existing SSL key. |
java.lang.Object |
realm |
java.lang.Boolean |
reloadableForces context scanning if you don't use a context file. |
java.net.URL |
resolvedConfigFile |
java.lang.Object |
server |
java.lang.String |
stopKeyThe key to pass to Tomcat when requesting it to stop. |
java.lang.Integer |
stopPortThe TCP port which Tomcat should listen for admin requests. |
org.gradle.api.file.FileCollection |
tomcatClasspathClasspath for Tomcat libraries. |
java.io.File |
truststoreFileThe truststore file to use for SSL, if enabled. |
java.lang.String |
truststorePassThe truststore password to use for SSL, if enabled. |
java.util.List<TomcatUser> |
usersThe list of Tomcat users. |
java.io.File |
webDefaultXmlThe default web.xml. |
| Constructor and description |
|---|
AbstractTomcatRun
() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected void |
addWebappResource(java.io.File resource) |
|
protected void |
configureWebApplication()Configures web application |
|
protected java.lang.String |
getFullContextPath() |
|
void |
setWebApplicationContext() |
|
protected void |
start() |
|
void |
startTomcat() |
|
void |
user(java.lang.String username, java.lang.String password, java.util.List<java.lang.String> roles)Adds a Tomcat user by providing required fields. |
|
protected void |
validateConfiguration()Validates configuration and throws an exception if |
|
void |
validateConfigurationAndStartTomcat() |
Specifies the character encoding used to decode the URI bytes by the HTTP Connector. Defaults to "UTF-8".
Defines additional runtime JARs or directories that are not provided by the web application.
The TCP port which Tomcat should listen for AJP requests. Defaults to 8009.
The AJP protocol handler class name to be used. Defaults to org.apache.coyote.ajp.AjpProtocol.
The clientAuth setting to use, values may be: "true", "false" or "want". Defaults to "false".
The path to the Tomcat context XML file.
The URL context path under which the web application will be registered. Defaults to WAR name.
Specifies whether the Tomcat 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 Tomcat server is stopped. Defaults to false.
Determines whether the HTTPS connector should be created. Defaults to false.
The TCP port which Tomcat should listen for HTTP requests. Defaults to 8080.
The HTTP protocol handler class name to be used. Defaults to org.apache.coyote.http11.Http11Protocol.
The TCP port which Tomcat should listen for HTTPS requests. Defaults to 8443.
The HTTPS protocol handler class name to be used. Defaults to org.apache.coyote.http11.Http11Protocol.
The keystore file to use for SSL, if enabled (by default, a keystore will be generated).
The keystore password to use for SSL, if enabled.
The file to write Tomcat log messages to. If the file already exists new messages will be appended.
Doesn't override existing SSL key. Defaults to false.
Forces context scanning if you don't use a context file. Defaults to true.
The key to pass to Tomcat when requesting it to stop. Defaults to "stopKey".
The TCP port which Tomcat should listen for admin requests. Defaults to 8081.
Classpath for Tomcat libraries.
The truststore file to use for SSL, if enabled.
The truststore password to use for SSL, if enabled.
The list of Tomcat users. Defaults to an empty list.
The default web.xml. If it doesn't get defined an instance of org.apache.catalina.servlets.DefaultServlet and org.apache.jasper.servlet.JspServlet will be set up.
Configures web application
Adds a Tomcat user by providing required fields. Allows for adding users in enhanced tasks without having to know the plugin's API class representing a Tomcat user.
username - Usernamepassword - Passwordroles - RolesValidates configuration and throws an exception if
Groovy Documentation