I works in 2.1-RC2
if you use typesafe's config library directly, without Play's Configuration
wrapper. It's a Java API, so it is used slightly different than described in this answer.
In project/Build.scala
import the library:
import com.typesafe.config._
and load the configuration from the file manually. Calling resolve()
is needed to resolve substitutions.
val conf = ConfigFactory.parseFile(new File("conf/application.conf")).resolve()
val appName = conf.getString("app.name")
val appVersion = conf.getString("app.version")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…