我有一个玩!项目与单元测试,我想在我的分期环境使用SBT运行测试。在升级到Play 2.1之前,当我使用Play 2.0.4和sbt 0.11.3时,我可以做$ sbt -Dconfig.file=conf/staging.conf test
。无论我为-Dconfig.file指定什么,现在sbt test
似乎都使用默认的application.conf。如何使用sbt 0.12.2为sbt测试指定一个配置文件?
sbt start -Dconfig.file=conf/staging.conf
仍然正常工作。这种行为是否是sbt 0.12.2的错误,还是应该以不同的方式指定配置文件来运行测试?
如果你想Java选项加起来也只有'SBT test'而不是其他配置然后你可以做 'javaOptions in Test + =“-Dconfig.file = conf/test.conf”' [link](http://stackoverflow.com/questions/7121889/how-can-i-pass -jvm-options-to-sbt-to-use-when-running-the-app-or-test-cases) – fpearsall 2013-03-15 19:29:33