SBT:&符不是sbt.io.FileFilter的成员

时间:2019-02-09 23:39:36

标签: scala sbt

我正在尝试使用带有以下build.sbt的SBT创建一个初学者Scala应用程序

name := "Jala"

version := "0.1"

scalaVersion := "2.12.8"

libraryDependencies += "org.scalatest" && "scalatest" & "2.2.6" & "test"

我收到错误消息:

Error while importing sbt project:

[info] Loading settings for project global-plugins from idea.sbt ...
[info] Loading global plugins from C:\Users\janac\.sbt\1.0\plugins
[info] Loading project definition from C:\source\Jala\project
C:\source\Jala\build.sbt:7: error: value & is not a member of sbt.io.FileFilter
libraryDependencies += "org.scalatest" && "scalatest" & "2.2.6" & "test"
^
[error] Type error in expression

我不明白为什么错误消息提示“&”不是有效的成员...

1 个答案:

答案 0 :(得分:0)

使用&代替%并附加一个Seq,如下所示:

libraryDependencies ++= Seq(
    "org.scalatest" % "scalatest" % "2.2.6")

在不久的将来需要使用Seq可以附加更多的依赖项。