Vahid Pazirandeh
Vahid Pazirandeh

Reputation: 1592

How can a Grails plugin modify the app's default mappings/constraints config?

I'm creating a Grails plugin which will modify the value of the following config property:

grails.gorm.default.constraints

The problem is that by the time my plugin descriptor starts running (doWithSpring) if the Grails application that uses the plugin had an existing value for the default constraints property, it would have been already executed.

I'd like my plugin to modify the value of the default constraints before Grails begins executing it so that the constraints I'm adding will also be included. The default constraints closure seems to get executed multiple times during Grails app startup.

I've tried a few approaches:

grails.config.locations = ["classpath:FooConfig.class"] // Yes, *.class

Upvotes: 1

Views: 122

Answers (0)

Related Questions