gpt4 book ai didi

grails - grails如何在config.groovy之前加载外部配置文件

转载 作者:行者123 更新时间:2023-12-02 14:15:23 26 4
gpt4 key购买 nike

Grails应用程序基于我的外部属性文件,然后我想在config.groovy(grails.plugins.springsecurity.providerNames)中加载适当的提供程序。这意味着根据外部配置中的属性在config.groovy中进行检查。有没有一种方法可以在config.groovy或其他建议之前加载外部配置?

最佳答案

看看Externalized Configs。特别,

Values that have the same name as previously defined values will overwrite the existing values, and the pointed to configuration sources are loaded in the order in which they are defined.



配置默认

The configuration values contained in the locations described by the grails.config.locations property will override any values defined in your application Config.groovy file which may not be what you want. You may want to have a set of default values be be loaded that can be overridden in either your application's Config.groovy file or in a named config location. For this you can use the grails.config.defaults.locations property.

关于grails - grails如何在config.groovy之前加载外部配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20999501/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com