Farm configuration defines it’s own set of server-specific properties. When you run a farm task, it uses server-specific properties defined in farm configuration and ignores server-specific properties defined in gretty configurations. For example:

gretty {
  httpPort = 8181
}

farm {
  httpPort = 9191
  webapp project
}
  • when you invoke gradle farmRun, it serves port 9191.

  • when you invoke gradle appRun, it serves port 8181.

Server-specific properties

Property Type Default Purpose

jvmArgs

List<String>

[]

Additional JVM arguments to servlet-container process.

servletContainer

String

'jetty9'

Servlet container to be used in farmXXX tasks. Possible values are 'jetty7', 'jetty8', 'jetty9', 'tomcat7', 'tomcat8'.

managedClassReload

boolean

false

When true, Gretty gradle tasks facilitate your web-app with springloaded library, thus allowing to live-reload compiled classes and avoid restarting servlet container.
See also: Hot deployment.

host

String

"localhost"

host is passed to servlet-container connectors. If you use HTTPS, host must match CN of the subject DN of the certificate (if you use HTTP auto-configuration, this is ensured automatically).

httpEnabled

boolean

true

When httpEnabled is true, Gretty configures HTTP connector for the designated httpPort. Otherwise HTTP protocol is disabled. Normally either httpEnabled or httpsEnabled should be true.

httpPort

int

8080

TCP-port used by servlet-container for incoming HTTP-requests.

port

int

8080

This property is exactly the same as httpPort

httpIdleTimeout

int

null

When not null, defines the time, in milliseconds, that the HTTP connection can be idle before it is closed.

httpsEnabled

boolean

false

When httpsEnabled is true, Gretty configures HTTPS connector for the designated httpsPort. Otherwise HTTPS protocol is disabled. Normally either httpEnabled or httpsEnabled should be true.
See also: HTTPS support.

httpsPort

int

8443

TCP-port used by servlet-container for incoming HTTPS-requests.
Attention: setting httpsPort alone is not enough to enable HTTPS protocol. You must set httpsEnabled=true in order to enable HTTPS.

sslKeyStorePath

String or java.io.File

null

Absolute or relative path to the key-store, containing key and certificate for HTTPS connection. If sslKeyStorePath is not specified, all other SSL-related properties are ignored and HTTPS is auto-configured (if it is enabled).
See also: HTTPS manual configuration

sslKeyStorePassword

String

null

Password for the key-store designated by property sslKeyStorePath.
See also: HTTPS manual configuration

sslKeyManagerPassword

String

sslKeyStorePassword

Password for the key of this host, stored in key-store designated by property sslKeyStorePath.
See also: HTTPS manual configuration

sslTrustStorePath

String or java.io.File

sslKeyStorePath

Absolute or relative path to the trust-store for HTTPS connection.
See also: HTTPS manual configuration

sslKeyStorePassword

String

null

Password for the key-store designated by property sslKeyStorePath.
See also: HTTPS manual configuration

httpsIdleTimeout

int

null

When not null, defines the time, in milliseconds, that the HTTPS connection can be idle before it is closed.

serverConfigFile

String or java.io.File

"jetty.xml" or "tomcat.xml"

Name and/or location of servlet-container-specific server configuration file.
See also: jetty.xml support and tomcat.xml support.

jettyXmlFile

String or java.io.File

"jetty.xml"

Name and/or location of "jetty.xml" file.
See also: jetty.xml support.

realm

String

null

Security realm for the given farm.
See also: Jetty security realms and Tomcat security realms.

realmConfigFile

String or java.io.File

"jetty-realm.properties" or "tomcat-users.xml"

Contains security realm properties for the given farm.
See also: Jetty security realms and Tomcat security realms.

singleSignOn

boolean

false

true, if single sign-on should be enabled for the given farm.
See also: Single sign on.

scanInterval

int

1

Hot-deployment scan interval, in seconds.
See also: Hot deployment.

logbackConfigFile

String

"logback.groovy" or "logback.xml"

Absolute or relative path to logback configuration file (.groovy or .xml).
See also: Logging.

loggingLevel

String

"INFO"

slf4j logging-level for servlet-container process.
See also: Logging.

consoleLogEnabled

boolean

true

Defines whether log messages are written to the terminal.
See also: Logging.

fileLogEnabled

boolean

true

Defines, whether log messages are written to the log-file.
See also: Logging.

logFileName

String

"${project.name}.log"

Log file name (without path).
See also: Logging.

logDir

String

"${user.home}/logs"

Directory, where the log file is created.
See also: Logging.

onStart

function(Closure)

-

Adds closure to be called just before servlet-container is started.

onStop

function(Closure)

-

Adds closure to be called just after servlet-container is stopped.

onScan

function(Closure)

-

Adds closure to be called on hot-deployment scan.
See also: Hot deployment.

onScanFilesChanged

function(Closure)

-

Adds closure to be called whenever hot-deployment detects that files or folders were changed.
See also: Hot deployment.

servicePort

int

9900

TCP-port used by Gretty to send commands to servlet-container process.

statusPort

int

9901

TCP-port used by servlet-container process to send status back to Gretty.

See also: