scala - SBT:与号 (&) 不是 sbt.io.FileFilter 的成员
问题描述
我正在尝试使用带有以下 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
我不明白为什么错误消息表明“&”不是有效成员......
解决方案
而不是&
使用%
和附加Seq
这样的:
libraryDependencies ++= Seq(
"org.scalatest" % "scalatest" % "2.2.6")
Seq
如果您在不久的将来需要,使用 a可以方便地附加更多依赖项。
推荐阅读
- java - 是否可以为 Set 设置精度
.contains()? - python - Celery + Django 在启动时
- android - 渲染问题在当前主题中找不到样式“bottomNavigationStyle”
- jquery - 如何使用 jQuery Validation 以准确的澳大利亚格式验证输入字段电话?
- php - 在哪里可以找到通过 TCP 接收的 GPS 数据?
- javascript - ajax循环settimeout,仅在前一个请求完成后才新请求
- javascript - 使用 new 关键字在构造函数中创建类的实例是不好的做法吗?
- c# - MVVMCross 如何实现 ContentDialog
- c# - 在 asp.net MVC 中处理 localhost 时,smpt 未在已发布时发送电子邮件
- wcf - SOAP Onvif 对 WCF 客户端没有响应