在sbt中,可以轻松地传递运行配置,例如:
sbt "run -Dlib.lib1.version=2.0.0"
但是当参数传递给sbt test时,类似的事情会失败。例如:
sbt "test -Dlib.lib1.version=2.0.0"
官方文档指出,sbt test不支持命令行参数:"The test task accepts no command line arguments and runs all tests"。我想使用不同版本的库运行测试,该版本保存在reference.conf中作为变量,并且我想在测试期间覆盖此变量,而无需每次更改reference.conf。
那么,我如何通过命令行参数将配置传递给sbt test?
sbt“testOnly -- -oU”
而不是通配符。 - js.