建议我将2个或更多配置文件用于不同的模式:
play -Dconfig.file=/conf/dev_application.conf run
那么,如何处理一些在不同模式下相同的通用设置?复制粘贴这些不是我要使用的。
如果可能的话,我会使用一个通用的配置文件:
play -Dconfig.file=/conf/dev_application.conf /conf/common_application.conf run
就我而言,这是不可能的。任何想法?
您可以使用以下include
语句将设置导入另一个配置文件中:
# Note that the name of the file being included must be quoted
include "common_application.conf"
这将从您的通用配置中导入所有配置条目。然后,您还可以在特定于模式的配置文件中覆盖所有这些较低的公用键的值:
foo=0
# Import common configuration
include "common_application.conf"
# Override common configuration
foo=1
# Dev configuration
bar=0
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句