# Global (applies to all environments)
grails:
serverURL: https://my.app.com
# Environment-specific overrides
environments:
development:
grails:
serverURL: http://localhost:8080
test:
grails:
serverURL: http://localhost:8080
production:
grails:
serverURL: https://my.app.com
Application Properties
A comprehensive reference of all configuration properties specific to Grails and its bundled modules. These properties are set in grails-app/conf/application.yml (or application.groovy).
Since Grails is built on Spring Boot, all Spring Boot Common Application Properties are also available (for example server.port, logging., spring.datasource.hikari., and management.*). This reference covers only Grails-specific properties.
Environment-Specific Configuration
Properties in application.yml (or application.groovy) are global by default - they apply to all environments. To override a property for a specific environment, nest it under an environments block:
Or in application.groovy:
grails.serverURL = 'https://my.app.com'
environments {
development {
grails.serverURL = 'http://localhost:8080'
}
test {
grails.serverURL = 'http://localhost:8080'
}
production {
grails.serverURL = 'https://my.app.com'
}
}
Core Properties
| Property | Description | Default |
|---|---|---|
|
The colour to show the banner art in, where the terminal colours output at all. A number selects one of the 256 colours a terminal offers; a name selects one of the eight it has always had, such as red or bright_blue; none leaves the art uncoloured. A value that is neither falls back to the default. |
|
|
Whether to display the Grails banner art. |
|
|
The file path on the classpath to the Grails banner art to display. |
|
|
The colour to show the mark in, separate from the art so it is not read as part of it. Takes the same values as grails.banner.art.color: a number for one of the 256 colours a terminal offers, a name for one of the eight it has always had, or none. |
|
|
Whether to say under the banner art how the application was started: NATIVE for an image, AOT CACHE for a JVM given a cache to read, AOT for one running generated bean definitions. An ordinary start says nothing. |
|
|
Says this instead of what was detected. Shown spaced and in upper case, and an empty value shows nothing. |
|
|
Whether to display version information in the Grails banner. |
|
|
A list of versions to exclude from the banner. |
|
|
A list of optional versions to include in the banner. |
|
|
A sorted list of versions to put first in the banner versions. |
|
|
Whether to skip execution of BootStrap.groovy classes on startup. |
|
|
The default package used when generating artefacts with grails create-* commands. |
|
|
Whether to perform native2ascii conversion of i18n properties files. |
|
|
List of plugin names to exclude from the plugin manager. |
|
|
List of plugin names to include in the plugin manager (all others excluded). |
|
|
The active Grails application profile (e.g., web, rest-api, plugin). |
|
|
The server URL used to generate absolute links (e.g., https://my.app.com) and used by redirects. |
|
|
List of packages to scan for Spring beans. |
|
|
Whether to disable AspectJ auto-weaving. |
|
|
The prefix for property placeholder resolution. |
|
|
Whether to enable Spring proxy-based transaction management since @Transactional uses an AST transform and proxies are typically redundant. |
|
Web & Controllers
| Property | Description | Default |
|---|---|---|
|
The default scope for controllers (singleton, prototype, session). |
|
|
Whether to log request parameters in exception stack traces. Defaults to true in development and false otherwise. |
|
|
List of parameter names to mask (replace with *) in exception stack traces, typically used for password and creditCard. Parameter names are matched case-insensitively. |
|
|
The character encoding for the Grails character encoding filter. |
|
|
Whether to force the encoding filter to set the encoding on the response. |
|
|
Fully qualified class name of a custom StackTraceFilterer implementation. |
|
|
Whether to cache links generated by the link generator. |
|
|
Whether to remove Spring Boot’s defaultViewResolver bean so Grails' own view resolution is used. |
|
|
Whether to remove Spring Boot’s welcome-page handler mapping so Grails' URL mappings own the root path ('/') rather than serving a static index.html for it. |
|
|
The path the Grails dispatcher servlet is mapped to. |
|
|
The URL token converter strategy, use hyphenated for hyphen-separated URLs. |
|
CORS
| Property | Description | Default |
|---|---|---|
|
Whether credentials (cookies, authorization headers) are supported. |
|
|
List of allowed request headers. |
|
|
List of allowed HTTP methods. |
|
|
List of allowed origins (e.g., http://localhost:5000), only applies when grails.cors.enabled is true. |
|
|
Whether CORS support is enabled. |
|
|
List of response headers to expose to the client. |
|
|
Whether CORS is handled via a servlet filter (true) or an interceptor (false). |
|
|
Map of URL patterns to per-path CORS configuration where defining any mapping disables the global /** mapping. |
|
|
How long (in seconds) the preflight response can be cached. |
|
Views & GSP
| Property | Description | Default |
|---|---|---|
|
Whether to disable GSP resource caching. |
|
|
Whether to enable GSP reloading in production. |
|
|
Custom directory for GSP view resolution. |
|
|
Fallback default for |
|
|
Whether to include the jsessionid in rendered links. |
|
|
Map of content types to encoding codecs. |
|
|
The codec applied to GSP ${} expressions. |
|
|
The codec applied to GSP <% %> scriptlet output. |
|
|
The codec applied to static HTML parts of GSP pages. |
|
|
The codec applied to tag library output. |
|
|
Whether every GSP is compiled statically, without each page declaring a compileStatic directive. |
|
|
Whether a statically compiled page is held to the names it declares, rather than only pages that declare a model. |
|
|
Tag library namespaces a statically compiled page may call, beyond those the framework supplies. A comma separated string or a list. |
|
|
The file encoding for GSP source files. |
|
|
Selects the HTML escaping style of the HTML codec. By default the XML-safe encoder is used. Set to |
|
|
Whether GSP layout preprocessing is enabled. Disabling allows Grails to parse rendered HTML but slows rendering. |
|
Content Negotiation & MIME Types
| Property | Description | Default |
|---|---|---|
|
The character encoding for converter output (JSON or XML) and for the response content types stamped by the default renderers used by respond(). |
|
|
List of user agent substrings (matched case-insensitively) for which Accept header processing is disabled. |
|
|
When true, XHR requests also respect the grails.mime.disable.accept.header.userAgents setting, while by default XHR requests ignore user agent filtering. |
|
|
Whether to use the file extension to determine the MIME type in content negotiation. |
|
|
Map of MIME type names to content type strings used for content negotiation. |
|
|
Whether to use the Accept header for content negotiation. |
|
Data Binding
| Property | Description | Default |
|---|---|---|
|
The maximum size to which indexed collections can auto-grow during data binding. |
|
|
Whether empty String values are converted to null during data binding. |
|
|
List of date format strings used to parse date values during data binding. |
|
|
Whether date parsing is lenient (accepting invalid dates like Feb 30). |
|
|
Whether mass data binding is denied for properties without an explicit bindable: true constraint or other allowlist entry. |
|
|
Whether to trim whitespace from String values during data binding. |
|
Internationalization
| Property | Description | Default |
|---|---|---|
|
How long (in seconds) resolved message bundles are cached. Honoured only when reload is enabled, as before. |
|
|
The locale of the base message bundle, always offered by a language selector and used by the 'fixed' locale resolver. Falls back to the JVM default when unset. |
|
|
Whether message bundles contributed by plugins participate, both in message resolution and in the locales offered by a language selector. Bundle caching, encoding and locale fallback are configured through spring.messages.* instead. |
|
|
The locale resolution strategy. 'session' and 'cookie' are mutable (the ?lang= switch works); 'acceptHeader' and 'fixed' are read-only (the ?lang= switch is ignored). |
|
Static Resources
| Property | Description | Default |
|---|---|---|
|
The cache period (in seconds) for static resource HTTP responses. |
|
|
Whether serving static files from src/main/resources/public is enabled. |
|
|
The URL path pattern for serving static resources. |
|
URL Mappings
| Property | Description | Default |
|---|---|---|
|
The maximum size of the URL mapping cache. |
|
Scaffolding
| Property | Description | Default |
|---|---|---|
|
The suffix appended to domain class names when generating scaffolding templates. |
Development & Reloading
| Property | Description | Default |
|---|---|---|
|
List of fully qualified class names to exclude from development reloading. |
|
|
List of fully qualified class names to include in development reloading, when set only these classes are reloaded. |
|
Events
| Property | Description | Default |
|---|---|---|
|
Whether to bridge GORM/Grails events to the Spring ApplicationEventPublisher, allowing EventListener methods to receive domain events. |
|
JSON & Converters
| Property | Description | Default |
|---|---|---|
|
Whether to include the class property when marshalling domain objects to JSON. |
|
|
Whether to include the class attribute when marshalling domain objects to XML. |
|
|
Whether to use the legacy JSON builder. |
|
GORM
| Property | Description | Default |
|---|---|---|
|
Whether to automatically flush the Hibernate session between queries. |
|
|
Whether to autowire Spring beans into domain class instances. |
|
|
Map of custom GORM types. |
|
|
A closure applied as the default constraints for all domain classes. |
|
|
A closure applied as the default mapping block for all domain classes. |
|
|
Whether an unconstrained persistent property is nullable by default (Grails 8). Set to false to restore the legacy required-by-default behaviour. |
|
|
Effective identity type for precompiled plugin domains that declare Serializable id. Accepted values are long and native. |
|
|
Whether auto-timestamp (dateCreated) overwrites a user-provided value on insert. |
|
|
When true, save() throws ValidationException on validation failure instead of returning null and can also be a list of package names to apply selectively. |
|
|
The default Hibernate flush mode (AUTO, COMMIT, MANUAL). |
|
|
Whether to mark a domain instance as dirty on an explicit save() call. |
|
|
The multi-tenancy mode: DISCRIMINATOR, DATABASE, SCHEMA, or NONE. |
|
|
Fully qualified class name of the TenantResolver implementation. |
|
|
Whether to translate GORM events into Reactor events, which is disabled by default for performance. |
|
DataSource
| Property | Description | Default |
|---|---|---|
|
The schema generation strategy: create-drop, create, update, validate, or none, use none in production with a migration tool. The default applies in every environment; generated applications set it per environment in application.yml. |
|
|
The Hibernate dialect class name or class. |
|
|
The JDBC driver class name. When not set, the connection pool derives the driver from the JDBC URL. |
|
|
Whether to format logged SQL for readability. |
|
|
Whether to register JMX MBeans for Tomcat JDBC pool DataSources that set jmxEnabled in their properties. |
|
|
Whether to log SQL statements to stdout. |
|
|
The database password. When not set, connections are opened without a password. H2 applications usually set an empty password. |
|
|
For additional datasources, whether to wire up the persistence interceptor (the default datasource is always wired). |
|
|
Whether to use a connection pool. |
|
|
Whether the DataSource is read-only (calls setReadOnly(true) on connections). |
|
|
For additional datasources, whether to include in the chained transaction manager. |
|
|
The connection pool implementation class when multiple are on the classpath. |
|
|
The JDBC connection URL. |
|
|
The database username. When not set, connections are opened without a username. H2 applications usually set sa. |
Hibernate
| Property | Description | Default |
|---|---|---|
|
Whether to cache Hibernate queries. |
|
|
Whether to enable Hibernate’s query cache. |
|
|
Whether to enable Hibernate’s second-level cache. |
|
Database Migration Plugin
| Property | Description | Default |
|---|---|---|
|
The name of the main changelog file. For named datasources uses |
|
|
The directory containing changelog files. |
|
|
Comma-delimited list of Liquibase contexts to use for all operations. |
|
|
The name of the Liquibase lock table used to prevent concurrent migrations. |
|
|
The name of the Liquibase changelog tracking table. |
|
|
Whether to drop all database tables before auto-running migrations at startup. |
|
|
Comma-delimited list of database objects to ignore in diff and generate operations. |
|
|
Comma-delimited list of database objects to include in diff and generate operations (all others excluded). |
|
|
List of main class names for which startup migrations are skipped, preventing migrations when running CLI commands. |
|
|
Whether to run changesets at startup for all configured datasources. |
|
|
Whether to run changesets from the specified file at application startup. |
|
|
Liquibase contexts to activate when running migrations at startup. Empty means all contexts. |
|
|
The default database schema to use when running migrations at startup. |
|
|
The changelog file name to run at startup. For named datasources uses |
|
|
Liquibase labels to filter changesets when running migrations at startup. Empty means all labels. |
|
Cache Plugin
| Property | Description | Default |
|---|---|---|
|
The cache manager implementation class name. Use |
|
|
Map of cache-specific configurations keyed by cache name, each supporting a |
|
|
Whether to clear all caches when the application starts. |
|
|
Location of the Ehcache XML configuration file on the classpath. |
|
|
The timeout in milliseconds for acquiring a lock on a cache element. |
|
|
Whether the cache plugin is enabled. |
|
MongoDB GORM Plugin
| Property | Description | Default |
|---|---|---|
|
Whether GORM creates the indexes declared in domain class mapping blocks by itself when the datastore starts. When false, the indexes already on the server are left untouched until MongoDatastore.buildIndex() is called. |
|
|
Whether index builds, the one on startup and any started with MongoDatastore.buildIndex(), run on a background thread instead of blocking the thread that starts them. |
|
|
List of custom MongoDB Codec classes to register for BSON serialization. |
|
|
The MongoDB database name. |
|
|
Whether to use Decimal128 for BigDecimal values instead of Double. |
|
|
A closure applied as the default GORM mapping block for all MongoDB domain classes. |
|
|
The MongoDB server hostname. Ignored when |
|
|
The password for MongoDB authentication. |
|
|
The MongoDB server port. Ignored when |
|
|
Whether to use stateless mode with no session-level caching of entities. |
|
|
The MongoDB connection URL. Supports the full MongoDB connection string format. |
|
|
The username for MongoDB authentication. |
Grails entity proxy behavior
| Property | Description | Default |
|---|---|---|
|
Whether toString() on an uninitialized entity proxy returns entityName:id without initializing it. When false (the default, matching Grails 7 and earlier), toString() initializes the proxy and delegates to the domain class’s own implementation. |
|
JSON Views
| Property | Description | Default |
|---|---|---|
|
Whether to allow HAL resource expansion in JSON views. |
|
|
The base template class for JSON Views. |
|
|
Whether to cache compiled JSON View templates. Defaults to false in development and true otherwise. |
|
|
Whether JSON views are statically compiled. |
|
|
Whether JSON Views are reloaded when they change. Defaults to true in development and false otherwise. |
|
|
The character encoding for JSON views. |
|
|
The file extension for JSON View templates. |
|
|
The SimpleDateFormat pattern for java.util.Date and Calendar values and map keys in JSON views. |
|
|
Whether to escape Unicode characters in JSON output. |
|
|
The locale for the grails.views.json.generator.dateFormat pattern. |
|
|
The time zone that the grails.views.json.generator.dateFormat pattern writes java.util.Date and Calendar values in. |
|
|
MIME types handled by JSON views. |
|
|
Packages imported into JSON View templates. |
|
|
The package name used for compiled JSON Views. Defaults to the application name. |
|
|
Whether to pretty-print JSON output with indentation. |
|
|
Static classes imported into JSON View templates. |
|
|
The filesystem path containing JSON View templates. Defaults to the environment reload location or application views directory. |
|
|
Whether links generated by JSON Views use absolute URLs. |
|
Markup Views
| Property | Description | Default |
|---|---|---|
|
Whether to allow resource expansion in Markup Views. |
|
|
Whether to escape XML special characters in Markup Views. |
|
|
Whether to indent generated markup automatically. |
|
|
The string used for each automatic indentation level. |
` ` |
|
Whether to insert new lines in generated markup automatically. |
|
|
The base template class for Markup Views. |
|
|
Whether to cache compiled Markup View templates. Defaults to false in development and true otherwise. |
|
|
Whether the markup template engine caches compiled templates. Defaults to false in development and true otherwise. |
|
|
Whether Markup Views are statically compiled. |
|
|
The character encoding declared in generated XML declarations. |
|
|
Whether Markup Views are reloaded when they change. Defaults to true in development and false otherwise. |
|
|
The character encoding for Markup Views. |
|
|
Whether empty markup elements use expanded opening and closing tags. |
|
|
The file extension for Markup View templates. |
|
|
The locale used by the markup template engine. |
|
|
MIME types handled by Markup Views. |
|
|
The string used for generated line breaks. |
|
|
Packages imported into Markup View templates. |
|
|
The package name used for compiled Markup Views. Defaults to the application name. |
|
|
Whether to pretty-print generated markup. |
|
|
Static classes imported into Markup View templates. |
|
|
The filesystem path containing Markup View templates. Defaults to the environment reload location or application views directory. |
|
|
Whether links generated by Markup Views use absolute URLs. |
|
|
Whether generated markup uses double quotes for attribute values. |
|
MongoDB GORM Plugin - Client Options
| Property | Description | Default |
|---|---|---|
|
Application name sent to MongoDB for server logs and profiling. |
|
|
The MongoDB read concern level (e.g., local, majority, linearizable). |
|
|
The MongoDB read preference (e.g., primary, secondary, nearest). |
|
|
Whether to retry read operations on transient network errors. |
|
|
Whether to retry write operations on transient network errors. |
|
|
The MongoDB write concern (e.g., majority, w1, journaled). |
MongoDB GORM Plugin - Connection Pool
| Property | Description | Default |
|---|---|---|
|
Maximum idle time in milliseconds before a pooled connection is closed (0 for unlimited). |
|
|
Maximum lifetime in milliseconds of a pooled connection (0 for unlimited). |
|
|
Maximum number of connections in the connection pool. |
|
|
Maximum time in milliseconds to wait for a connection from the pool. |
|
|
Minimum number of connections in the connection pool. |
|
MongoDB GORM Plugin - SSL
| Property | Description | Default |
|---|---|---|
|
Whether to enable TLS/SSL for connections to MongoDB. |
|
|
Whether to allow connections to MongoDB servers with invalid hostnames in TLS certificates. |
|
OpenAPI
| Property | Description | Default |
|---|---|---|
|
Whether only actions that declare @Operation, or whose controller declares @Tag, are described. |
|
|
A resource location, such as classpath:openapi-base.yml, of a YAML or JSON document the description starts from. |
|
|
The media types an operation of the default document must consume, exactly. |
|
|
The title of the default document, in place of info.app.name. |
|
|
Whether the OpenAPI description is generated at all. |
|
|
Groups, each a document of its own, by name, each taking display-name and the same path, package, media type and header settings as the default document. |
|
|
The header conditions an operation of the default document must declare, such as Accept-Version=1.0. |
|
|
Whether the create and edit actions of a RestfulController, which answer HTML forms, are described. |
|
|
Where the generate-open-api command writes the documents. |
|
|
Whether the generate-open-api command writes yaml or json. |
|
|
The packages, with their sub-packages, of the controllers the default document leaves out. |
|
|
The packages, with their sub-packages, of the controllers the default document describes. |
|
|
Ant patterns of the paths the default document leaves out. |
|
|
Ant patterns of the paths the default document describes. |
|
|
The media types an operation of the default document must produce, exactly. |
Plugin References
The following plugin documentation covers configuration properties that are not listed above: