解决方法
类似于Marijn的回答.这就是我通常设置Config.groovy的方法.我仍然将它用于某些设置,但任何环境(部署位置或单个机器)更改都可以覆盖Config.groovy中的任何设置.
Config.groovy>>>>
grails.config.locations = [ "file:../app-config/myapp-dataSource.groovy","file:../app-config/myapp-config.groovy" ] environments { development { grails.config.locations = [ "file:../myapp-config/myapp-dataSource.groovy","file:../myapp-config/myapp-config.groovy","file:${userHome}/myapp-config/myapp-dataSource.groovy","file:${userHome}/myapp-config/myapp-config.groovy" ] some.config.setting=true } }
file:${userHome} /myapp-config/myapp-config.groovy\u0026gt;>>>
some.config.setting=false