如何更新外部配置文件而不在 Grails 中重建 war 文件 [英] How to update external config files without rebuilding war file in Grails

查看:30
本文介绍了如何更新外部配置文件而不在 Grails 中重建 war 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更新外部配置文件(例如:config-ex.groovyconfig-ex.properties)而不在 Grails 中重建 war 文件?

How to update external config files (e.g.: config-ex.groovy, config-ex.properties) without rebuilding the war file in Grails?

重新启动应用服务器将应用来自外部配置文件的新更新.

Restarting the application server will apply the new updates from external config files.

推荐答案

如果我理解你想在战争之外具体化 Grails 配置.您可以像这样在 config.groovy 中定义外部配置

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"]

请参阅 Grails 文档 4.4 外部化配置

See the Grails doc 4.4 Externalized Configuration

这篇关于如何更新外部配置文件而不在 Grails 中重建 war 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆