(Quick Reference)

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:

# 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

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

grails.bootstrap.skip

Whether to skip execution of BootStrap.groovy classes on startup.

false

grails.codegen.defaultPackage

The default package used when generating artefacts with grails create-* commands.

Set by project template

grails.enable.native2ascii

Whether to perform native2ascii conversion of i18n properties files.

true

grails.plugin.excludes

List of plugin names to exclude from the plugin manager.

[]

grails.plugin.includes

List of plugin names to include in the plugin manager (all others excluded).

[]

grails.profile

The active Grails application profile (e.g., web, rest-api, plugin).

Set by project template

grails.serverURL

The server URL used to generate absolute links (e.g., https://my.app.com) and used by redirects.

derived from request

grails.spring.bean.packages

List of packages to scan for Spring beans.

[]

grails.spring.disable.aspectj.autoweaving

Whether to disable AspectJ auto-weaving.

false

grails.spring.placeholder.prefix

The prefix for property placeholder resolution.

${

grails.spring.transactionManagement.proxies

Whether to enable Spring proxy-based transaction management since @Transactional uses an AST transform and proxies are typically redundant.

false

Web & Controllers

Property Description Default

grails.controllers.defaultScope

The default scope for controllers (singleton, prototype, session).

singleton

grails.controllers.upload.fileSizeThreshold

File size threshold (in bytes) above which uploads are written to disk.

0

grails.controllers.upload.location

The directory for temporary file uploads.

System.getProperty('java.io.tmpdir')

grails.controllers.upload.maxFileSize

Maximum file size for uploads (in bytes).

1048576

grails.controllers.upload.maxRequestSize

Maximum request size for multipart uploads (in bytes).

10485760

grails.exceptionresolver.logRequestParameters

Whether to log request parameters in exception stack traces.

true

grails.exceptionresolver.params.exclude

List of parameter names to mask (replace with [*]) in exception stack traces, typically used for password and creditCard.

[]

grails.filter.encoding

The character encoding for the Grails character encoding filter.

UTF-8

grails.filter.forceEncoding

Whether to force the encoding filter to set the encoding on the response.

true

grails.logging.stackTraceFiltererClass

Fully qualified class name of a custom StackTraceFilterer implementation.

org.grails.exceptions.reporting.DefaultStackTraceFilterer

grails.web.linkGenerator.useCache

Whether to cache links generated by the link generator.

true

grails.web.servlet.path

The path the Grails dispatcher servlet is mapped to.

/**

grails.web.url.converter

The URL token converter strategy, use hyphenated for hyphen-separated URLs.

camelCase

CORS

Property Description Default

grails.cors.allowCredentials

Whether credentials (cookies, authorization headers) are supported.

false

grails.cors.allowedHeaders

List of allowed request headers.

["*"]

grails.cors.allowedMethods

List of allowed HTTP methods.

["*"]

grails.cors.allowedOrigins

List of allowed origins (e.g., http://localhost:5000), only applies when grails.cors.enabled is true.

["*"]

grails.cors.enabled

Whether CORS support is enabled.

false

grails.cors.exposedHeaders

List of response headers to expose to the client.

[]

grails.cors.filter

Whether CORS is handled via a servlet filter (true) or an interceptor (false).

true

grails.cors.mappings

Map of URL patterns to per-path CORS configuration where defining any mapping disables the global /** mapping.

{}

grails.cors.maxAge

How long (in seconds) the preflight response can be cached.

1800

Views & GSP

Property Description Default

grails.gsp.disable.caching.resources

Whether to disable GSP resource caching.

false

grails.gsp.enable.reload

Whether to enable GSP reloading in production.

false

grails.gsp.view.dir

Custom directory for GSP view resolution.

grails-app/views

grails.views.default.codec

Fallback default for grails.views.gsp.codecs.expression, scriptlet, taglib and staticparts when those are not set. Options: none, html, base64.

html

grails.views.enable.jsessionid

Whether to include the jsessionid in rendered links.

false

grails.views.filteringCodecForContentType

Map of content types to encoding codecs.

{}

grails.views.gsp.codecs.expression

The codec applied to GSP ${} expressions.

html

grails.views.gsp.codecs.scriptlet

The codec applied to GSP <% %> scriptlet output.

html

grails.views.gsp.codecs.staticparts

The codec applied to static HTML parts of GSP pages.

none

grails.views.gsp.codecs.taglib

The codec applied to tag library output.

none

grails.views.gsp.encoding

The file encoding for GSP source files.

UTF-8

grails.views.gsp.htmlcodec

Selects the HTML escaping style for GSP output. When not set (or when the value does not start with xml or equal (ignoring case) xhtml), a legacy HTML4-compatible encoder is used. Set to xml or xhtml to use the XML-safe encoder.

grails.views.gsp.layout.preprocess

Whether GSP layout preprocessing is enabled. Disabling allows Grails to parse rendered HTML but slows rendering.

true

Content Negotiation & MIME Types

Property Description Default

grails.converters.encoding

The character encoding for converter output (JSON or XML).

UTF-8

grails.mime.disable.accept.header.userAgents

List of user agent substrings (matched case-insensitively) for which Accept header processing is disabled.

["Gecko", "WebKit", "Presto", "Trident"]

grails.mime.disable.accept.header.userAgentsXhr

When true, XHR requests also respect the grails.mime.disable.accept.header.userAgents setting, while by default XHR requests ignore user agent filtering.

false

grails.mime.file.extensions

Whether to use the file extension to determine the MIME type in content negotiation.

true

grails.mime.types

Map of MIME type names to content type strings used for content negotiation.

see web profile application.yml

grails.mime.use.accept.header

Whether to use the Accept header for content negotiation.

true

Data Binding

Property Description Default

grails.databinding.autoGrowCollectionLimit

The maximum size to which indexed collections can auto-grow during data binding.

256

grails.databinding.convertEmptyStringsToNull

Whether empty String values are converted to null during data binding.

true

grails.databinding.dateFormats

List of date format strings used to parse date values during data binding.

["yyyy-MM-dd HH:mm:ss.S", "yyyy-MM-dd’T’HH:mm:ss’Z'", "yyyy-MM-dd HH:mm:ss.S z", "yyyy-MM-dd’T’HH:mm:ssX"]

grails.databinding.dateParsingLenient

Whether date parsing is lenient (accepting invalid dates like Feb 30).

false

grails.databinding.trimStrings

Whether to trim whitespace from String values during data binding.

true

Internationalization

Property Description Default

grails.i18n.cache.seconds

How long (in seconds) to cache resolved message bundles with -1 to cache indefinitely and 0 to disable caching.

-1

grails.i18n.filecache.seconds

How long (in seconds) to cache the message bundle file lookup with -1 to cache indefinitely.

-1

Static Resources

Property Description Default

grails.resources.cachePeriod

The cache period (in seconds) for static resource HTTP responses.

0

grails.resources.enabled

Whether serving static files from src/main/resources/public is enabled.

true

grails.resources.pattern

The URL path pattern for serving static resources.

/static/**

URL Mappings

Property Description Default

grails.urlmapping.cache.maxsize

The maximum size of the URL mapping cache.

1000

Scaffolding

Property Description Default

grails.scaffolding.templates.domainSuffix

The suffix appended to domain class names when generating scaffolding templates.

Development & Reloading

Property Description Default

grails.reload.excludes

List of fully qualified class names to exclude from development reloading.

[]

grails.reload.includes

List of fully qualified class names to include in development reloading, when set only these classes are reloaded.

[]

Events

Property Description Default

grails.events.spring

Whether to bridge GORM/Grails events to the Spring ApplicationEventPublisher, allowing EventListener methods to receive domain events.

true

JSON & Converters

Property Description Default

grails.converters.json.domain.include.class

Whether to include the class property when marshalling domain objects to JSON.

false

grails.converters.xml.domain.include.class

Whether to include the class attribute when marshalling domain objects to XML.

false

grails.json.legacy.builder

Whether to use the legacy JSON builder.

false

GORM

Property Description Default

grails.gorm.autoFlush

Whether to automatically flush the Hibernate session between queries.

false

grails.gorm.autowire

Whether to autowire Spring beans into domain class instances.

true

grails.gorm.custom.types

Map of custom GORM types.

{}

grails.gorm.default.constraints

A closure applied as the default constraints for all domain classes.

{}

grails.gorm.default.mapping

A closure applied as the default mapping block for all domain classes.

{}

grails.gorm.events.autoTimestampInsertOverwrite

Whether auto-timestamp (dateCreated) overwrites a user-provided value on insert.

true

grails.gorm.failOnError

When true, save() throws ValidationException on validation failure instead of returning null and can also be a list of package names to apply selectively.

false

grails.gorm.flushMode

The default Hibernate flush mode (AUTO, COMMIT, MANUAL).

AUTO

grails.gorm.markDirty

Whether to mark a domain instance as dirty on an explicit save() call.

true

grails.gorm.multiTenancy.mode

The multi-tenancy mode: DISCRIMINATOR, DATABASE, SCHEMA, or NONE.

NONE

grails.gorm.multiTenancy.tenantResolverClass

Fully qualified class name of the TenantResolver implementation.

required when mode is not NONE

grails.gorm.reactor.events

Whether to translate GORM events into Reactor events, which is disabled by default for performance.

false

DataSource

Property Description Default

dataSource.dbCreate

The schema generation strategy: create-drop, create, update, validate, or none, use none in production with a migration tool.

create-drop (dev), none (prod)

dataSource.dialect

The Hibernate dialect class name or class.

auto-detected from driver

dataSource.driverClassName

The JDBC driver class name.

org.h2.Driver

dataSource.formatSql

Whether to format logged SQL for readability.

false

dataSource.jmxExport

Whether to register JMX MBeans for the DataSource.

true

dataSource.logSql

Whether to log SQL statements to stdout.

false

dataSource.password

The database password.

dataSource.persistenceInterceptor

For additional datasources, whether to wire up the persistence interceptor (the default datasource is always wired).

false

dataSource.pooled

Whether to use a connection pool.

true

dataSource.readOnly

Whether the DataSource is read-only (calls setReadOnly(true) on connections).

false

dataSource.transactional

For additional datasources, whether to include in the chained transaction manager.

true

dataSource.type

The connection pool implementation class when multiple are on the classpath.

com.zaxxer.hikari.HikariDataSource

dataSource.url

The JDBC connection URL.

jdbc:h2:mem:devDb

dataSource.username

The database username.

sa

Hibernate

Property Description Default

hibernate.cache.queries

Whether to cache Hibernate queries.

false

hibernate.cache.use_query_cache

Whether to enable Hibernate’s query cache.

false

hibernate.cache.use_second_level_cache

Whether to enable Hibernate’s second-level cache.

false

Database Migration Plugin

Property Description Default

grails.plugin.databasemigration.changelogFileName

The name of the main changelog file. For named datasources uses changelog-<name>.groovy.

changelog.groovy

grails.plugin.databasemigration.changelogLocation

The directory containing changelog files.

grails-app/migrations

grails.plugin.databasemigration.contexts

Comma-delimited list of Liquibase contexts to use for all operations.

grails.plugin.databasemigration.databaseChangeLogLockTableName

The name of the Liquibase lock table used to prevent concurrent migrations.

DATABASECHANGELOGLOCK

grails.plugin.databasemigration.databaseChangeLogTableName

The name of the Liquibase changelog tracking table.

DATABASECHANGELOG

grails.plugin.databasemigration.dropOnStart

Whether to drop all database tables before auto-running migrations at startup.

false

grails.plugin.databasemigration.excludeObjects

Comma-delimited list of database objects to ignore in diff and generate operations.

grails.plugin.databasemigration.includeObjects

Comma-delimited list of database objects to include in diff and generate operations (all others excluded).

grails.plugin.databasemigration.skipUpdateOnStartMainClasses

List of main class names for which startup migrations are skipped, preventing migrations when running CLI commands.

["grails.ui.command.GrailsApplicationContextCommandRunner"]

grails.plugin.databasemigration.updateAllOnStart

Whether to run changesets at startup for all configured datasources.

false

grails.plugin.databasemigration.updateOnStart

Whether to run changesets from the specified file at application startup.

false

grails.plugin.databasemigration.updateOnStartContexts

Liquibase contexts to activate when running migrations at startup. Empty means all contexts.

[]

grails.plugin.databasemigration.updateOnStartDefaultSchema

The default database schema to use when running migrations at startup.

grails.plugin.databasemigration.updateOnStartFileName

The changelog file name to run at startup. For named datasources uses changelog-<name>.groovy.

changelog.groovy

grails.plugin.databasemigration.updateOnStartLabels

Liquibase labels to filter changesets when running migrations at startup. Empty means all labels.

[]

Cache Plugin

Property Description Default

grails.cache.cacheManager

The cache manager implementation class name. Use GrailsConcurrentLinkedMapCacheManager for bounded caches with maxCapacity support.

GrailsConcurrentMapCacheManager

grails.cache.caches

Map of cache-specific configurations keyed by cache name, each supporting a maxCapacity setting (used by GrailsConcurrentLinkedMapCacheManager).

{}

grails.cache.clearAtStartup

Whether to clear all caches when the application starts.

false

grails.cache.ehcache.ehcacheXmlLocation

Location of the Ehcache XML configuration file on the classpath.

classpath:ehcache.xml

grails.cache.ehcache.lockTimeout

The timeout in milliseconds for acquiring a lock on a cache element.

200

grails.cache.enabled

Whether the cache plugin is enabled.

true

MongoDB GORM Plugin

Property Description Default

grails.mongodb.codecs

List of custom MongoDB Codec classes to register for BSON serialization.

[]

grails.mongodb.databaseName

The MongoDB database name.

grails.mongodb.decimalType

Whether to use Decimal128 for BigDecimal values instead of Double.

false

grails.mongodb.default.mapping

A closure applied as the default GORM mapping block for all MongoDB domain classes.

{}

grails.mongodb.host

The MongoDB server hostname. Ignored when url or connectionString is set.

localhost

grails.mongodb.password

The password for MongoDB authentication.

grails.mongodb.port

The MongoDB server port. Ignored when url or connectionString is set.

27017

grails.mongodb.stateless

Whether to use stateless mode with no session-level caching of entities.

false

grails.mongodb.url

The MongoDB connection URL. Supports the full MongoDB connection string format.

mongodb://localhost/test

grails.mongodb.username

The username for MongoDB authentication.

JSON Views

Property Description Default

grails.views.json.allowResourceExpansion

Whether to allow HAL resource expansion in JSON views.

true

grails.views.json.compileStatic

Whether JSON views are statically compiled.

true

grails.views.json.encoding

The character encoding for JSON views.

UTF-8

grails.views.json.generator.dateFormat

The date format pattern for JSON serialization.

yyyy-MM-dd’T’HH:mm:ss.SSSX

grails.views.json.generator.escapeUnicode

Whether to escape Unicode characters in JSON output.

false

grails.views.json.generator.locale

The locale for JSON output formatting.

en/US

grails.views.json.generator.timeZone

The time zone for JSON date serialization.

GMT

grails.views.json.mimeTypes

MIME types handled by JSON views.

["application/json", "application/hal+json"]

grails.views.json.prettyPrint

Whether to pretty-print JSON output with indentation.

false

MongoDB GORM Plugin - Client Options

Property Description Default

grails.mongodb.options.applicationName

Application name sent to MongoDB for server logs and profiling.

grails.mongodb.options.readConcern

The MongoDB read concern level (e.g., local, majority, linearizable).

grails.mongodb.options.readPreference

The MongoDB read preference (e.g., primary, secondary, nearest).

grails.mongodb.options.retryReads

Whether to retry read operations on transient network errors.

grails.mongodb.options.retryWrites

Whether to retry write operations on transient network errors.

grails.mongodb.options.writeConcern

The MongoDB write concern (e.g., majority, w1, journaled).

MongoDB GORM Plugin - Connection Pool

Property Description Default

grails.mongodb.options.connectionPoolSettings.maxConnectionIdleTime

Maximum idle time in milliseconds before a pooled connection is closed (0 for unlimited).

0

grails.mongodb.options.connectionPoolSettings.maxConnectionLifeTime

Maximum lifetime in milliseconds of a pooled connection (0 for unlimited).

0

grails.mongodb.options.connectionPoolSettings.maxSize

Maximum number of connections in the connection pool.

100

grails.mongodb.options.connectionPoolSettings.maxWaitTime

Maximum time in milliseconds to wait for a connection from the pool.

120000

grails.mongodb.options.connectionPoolSettings.minSize

Minimum number of connections in the connection pool.

0

MongoDB GORM Plugin - SSL

Property Description Default

grails.mongodb.options.sslSettings.enabled

Whether to enable TLS/SSL for connections to MongoDB.

false

grails.mongodb.options.sslSettings.invalidHostNameAllowed

Whether to allow connections to MongoDB servers with invalid hostnames in TLS certificates.

false

Plugin References

The following plugin documentation covers configuration properties that are not listed above: