我需要在 application.conf 文件中引用java.io.tmpdir
我打印了我的配置内容
val c = ConfigFactory.load()
System.err.println(c.root().render())
它使它像
# dev/application.conf: 1
"myapp" : {
# dev/application.conf: 47
"db" : {
# dev/application.conf: 49
"driver" : "org.h2.Driver",
# dev/application.conf: 48
"url" : "jdbc:h2:file:${java.io.tmpdir}/db;DB_CLOSE_DELAY=-1"
}
...
}
# system properties
"java" : {
# system properties
"io" : {
# system properties
"tmpdir" : "/tmp"
},
....
所以我猜前向引用不起作用。有什么方法可以在系统属性之后加载我的选项,以便配置解析器正确替换值?