如何更新外部配置文件而无需在Grails中重建war文件 [英] How can update external config files without rebuild war file in Grails
本文介绍了如何更新外部配置文件而无需在Grails中重建war文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何更新外部配置文件(例如: config-ex.groovy
, config-ex.properties
)无需在Grails中重建战争文件,重新启动重新启动服务器,应用程序将应用来自外部配置文件的新更新
你可以像这样在你的config.groovy中定义一个外部配置
grails.config.locations = [file :path / to / your / Configfile.groovy]
请参阅Grails doc 4.4外化配置
How can update external config files (e.g.: config-ex.groovy
, config-ex.properties
) without rebuilding the war file in Grails, restart restart server and app will apply new update from external config files
解决方案
If I understand well you want to externalized Grails config outside the war. You can define an external config in your config.groovy like this
grails.config.locations = ["file:path/to/your/Configfile.groovy"]
See the Grails doc 4.4 Externalized Configuration
这篇关于如何更新外部配置文件而无需在Grails中重建war文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文