# 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 |
|---|---|---|
|
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). |
|
|
File size threshold (in bytes) above which uploads are written to disk. |
|
|
The directory for temporary file uploads. |
|
|
Maximum file size for uploads (in bytes). |
|
|
Maximum request size for multipart uploads (in bytes). |
|
|
Whether to log request parameters in exception stack traces. |
|
|
List of parameter names to mask (replace with [*]) in exception stack traces, typically used for password and creditCard. |
|
|
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. |
|
|
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. |
|
|
The file encoding for GSP source files. |
|
|
Selects the HTML escaping style for GSP output. When not set (or when the value does not start with |
|
|
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). |
|
|
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 to trim whitespace from String values during data binding. |
|
Internationalization
| Property | Description | Default |
|---|---|---|
|
How long (in seconds) to cache resolved message bundles with -1 to cache indefinitely and 0 to disable caching. |
|
|
How long (in seconds) to cache the message bundle file lookup with -1 to cache indefinitely. |
|
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 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 Hibernate dialect class name or class. |
|
|
The JDBC driver class name. |
|
|
Whether to format logged SQL for readability. |
|
|
Whether to register JMX MBeans for the DataSource. |
|
|
Whether to log SQL statements to stdout. |
|
|
The database 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. |
|
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 |
|---|---|---|
|
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. |
JSON Views
| Property | Description | Default |
|---|---|---|
|
Whether to allow HAL resource expansion in JSON views. |
|
|
Whether JSON views are statically compiled. |
|
|
The character encoding for JSON views. |
|
|
The date format pattern for JSON serialization. |
|
|
Whether to escape Unicode characters in JSON output. |
|
|
The locale for JSON output formatting. |
|
|
The time zone for JSON date serialization. |
|
|
MIME types handled by JSON views. |
|
|
Whether to pretty-print JSON output with indentation. |
|
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. |
|
Plugin References
The following plugin documentation covers configuration properties that are not listed above: