我正在尝试了解build.sbt
文件。我想更好地组织我的build.sbt
文件,并在每行添加一个依赖项。
我阅读了文档,并说我需要使用关键字Seq
,并且格式类似于此:
libraryDependencies ++= Seq(
groupID % artifactID % revision,
groupID % otherID % otherRevision
)
并且我以为我理解了文档,但是显然不是因为当我尝试以这种方式添加多个依赖项时:
libraryDependencies ++= Seq(
"org.typelevel",
"cats-core" % "2.0.0",
"org.scala-lang.modules",
"scala-parser-combinators" % "1.1.2"
)
我收到以下错误:
build.sbt:26: error: No Append.Values[Seq[sbt.librarymanagement.ModuleID], Seq[Object]] found, so Seq[Object] cannot be appended to Seq[sbt.librarymanagement.ModuleID]
libraryDependencies ++= Seq(
^
[error] Type error in expression
所以我不确定自己在做什么错,经过无休止的谷歌搜索之后,我找不到其中包含多行的build.sbt
示例。
我发现了错误,并且我以错误的方式构造了buildDependencies
。我将其更改为:
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "2.0.0",
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"
)
并且有效。
我想我不完全了解%%
和%
之间的区别