Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala 不是有效的命令:在执行sbt it时将其删除_Scala_Sbt - Fatal编程技术网

Scala 不是有效的命令:在执行sbt it时将其删除

Scala 不是有效的命令:在执行sbt it时将其删除,scala,sbt,Scala,Sbt,我遵循了在中找到的添加集成测试的步骤 但是,当我运行sbt it时,请参见以下内容: $ sbt it [info] Loading project definition from myproj/project [info] Set current project to myproj (in build file:myproj/) [error] Not a valid command: it [error] Not a valid project ID: it [error] Expected

我遵循了在中找到的添加集成测试的步骤

但是,当我运行
sbt it
时,请参见以下内容:

$ sbt it
[info] Loading project definition from myproj/project
[info] Set current project to myproj (in build file:myproj/)
[error] Not a valid command: it
[error] Not a valid project ID: it
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: it
[error] it
[error]   ^

sbt测试
按预期工作

经过一番谷歌搜索后,我意识到问题在于集成测试与测试不太一样。要运行集成测试,配置略有不同:

sbt it:test

当我这样做时,一切正常。

中描述的是如何添加新配置,即
it
。有许多可用的配置,例如
编译
测试
运行时
文档
Pom
-您可以在对象中找到默认的
VAL

SBT的官方文档应解释为什么调用
SBT-it
需要使用
it
名称的命令或任务,但事实并非如此


it
配置将您可能在其他配置(如
test
中使用的任务绑定到可以重新配置的位置,以便集成测试位于
it
目录中(而不是在其默认目录中-
src/test
)。

sbt术语是
it
是一种“配置”。