configuration - Grails external config location for deployed war -


i have external config file use in development environment in order specify datasource of grails application. import external file in config.groovy using following lines :

   grails.config.locations = ["classpath:${appname}-config.groovy",                            "file:./${appname}-config.groovy"] if (system.properties["${appname}.config.location"]) {     println("found")    grails.config.locations << "file:" + system.properties["${appname}.config.location"] } 

this works expected , well. have issue when application deployed war file. locations config file hardcoded in config.groovy above. requirement allow customers specify location of own configuration file.

i'm stuck locations hardcoded in config.groovy before war file built. don't know how i'd go letting customer modify these values. don't want have build different war file each customer containing location of configuration file.

is there method of changing these values? or perhaps reasonable have hardcoded value customers should put configuration files? i'd interested see if has suggestions?

i have next working config. so, may useful you.

// condition may rewrited in groovy style final configbase = system.properties.'aaaaa.configbase' ? system.properties.'aaaaa.configbase':"${userhome}/.aaaaa/" grails.config.locations = [         // standart grails config         "classpath:${appname}-config.properties",         "classpath:${appname}-config.groovy",          // redhat openshift         "file:${userhome}/app-root/data/.aaaaa/${appname}-config.properties",         "file:${userhome}/app-root/data/.aaaaa/${appname}-config.groovy",          // based on system property -daaaaa.configbase         "file:${configbase}/${appname}-config.properties",         "file:${configbase}/${appname}-config.groovy", ] 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -