I would like to create a custom grails environment which combines the on-the-fly recompilation feature of the 'development' environment with the persistent database feature of the 'production' environment. However, I do not wish to alter either the development or production environment configurations.
I've tried using the -reloading command line parameter, however, it doesn't appear to have any effect.
It would be great if there were a flag that lived in the conf directory somewhere...
You can create a new environment in the DataSource.groovy file under the section
with your custom configuration, then
you can run a custom configuration with:
grails -Dgrails.env=customEnvironment run-app
https://grails.org/Environments
BTW, if you want your DB to be persistent you only have to change
dbCreate
to update:in the DataSource file in the environment you want to be persistent.