【发布时间】:2019-04-02 15:08:14
【问题描述】:
我有一个 Typesafe 配置文件 (application.conf)。我想用系统环境变量覆盖一些设置(比如Overriding configuration with environment variables in typesafe config),但是我想对环境变量中的值做一些修改(例如toLowerCase,replace('\','/'),split ("/"))
所以我有这样的事情:
# C:\Users\...\project_root\sub_project\src\main\resources\application.conf
foo = {
bar = "baz"
}
我把它改成这样:
foo = {
bar = "baz"
bar = ${?FOO}
}
但现在我想这样做:
foo = {
bar = "baz"
bar = ${?FOO.toLowerCase}
}
当我在我的项目上运行 sbt update 时,我拥有的 Typesafe Config 依赖项是这样的:
[info] Resolving com.typesafe#config;1.2.1 ...
【问题讨论】:
-
为什么不在应用程序中解析配置后转换值?
标签: scala sbt config typesafe-config