grails custom development environment

96 Views Asked by At

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...

1

There are 1 best solutions below

0
On

You can create a new environment in the DataSource.groovy file under the section

environment {
developemnt { ...
}
production { ...}

test { ... }

custom{ .. //your code here}

}

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:

dbCreate = "update" 

in the DataSource file in the environment you want to be persistent.