Grials Externalizing properties

I wanted to add a properties files to the existing war file before app is deployed through a script.
Several steps
1) open the {appName}/grails-app/conf/Config.groovy
2) change “grails.config.locations” property in the file to

grails.config.locations = [“file:./grails-app/conf/${appName}-config.properties”]

3) create the {appName}-config.properties in

{appName}/grails-app/conf/

Possible problem: In war file, the properties file ends up in

WEB-INF\classes\

directory, so It might be better to just uncomment the
grails.config.locations existing already in step 2
Need to test.

Also see this site .

“The configuration mechanism of Grails is nice, but there is a small trouble. The configuration files are compiled and packed into the deployment package (WAR) during project build phase. However, one usually does not want to rebuild the whole application just to change say a database password. So, how to do it? “

This could be another option — but the problem is given a war file in tomcat how does one access those files
Does the

“file:${userHome}/.grails/${appName}-config.properties”

for the property ” “grails.config.locations” take care of it?
Need to test

Advertisements

Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: