SBT无法将Seq [Object]附加到Seq [ModuleID]

Aze*_*eli 5 scala sbt

SBT因不正确的追加错误而失败.我使用我已经看过很多次的构建文件的确切格式.

build.sbt:

lazy val backend = (project in file("backend")).settings(
name := "backend",
libraryDependencies ++= (Dependencies.backend)
).dependsOn(api).aggregate(api)
Run Code Online (Sandbox Code Playgroud)

dependencies.scala:

import sbt._

object Dependencies {

lazy val backend = common ++ metrics

val common = Seq(
"com.typesafe.akka" %% "akka-actor" % Version.akka,
"com.typesafe.akka" %% "akka-cluster" % Version.akka,
"org.scalanlp.breeze" %% "breeze" % Version.breeze,
"com.typesafe.akka" %% "akka-contrib" % Version.akka,
"org.scalanlp.breeze-natives" % Version.breeze,
"com.google.guava" % "guava" % "17.0"
)

val metrics = Seq("org.fusesource" % "sigar" % "1.6.4")
Run Code Online (Sandbox Code Playgroud)

我不是为什么SBT抱怨的原因

error: No implicit for Append.Values[Seq[sbt.ModuleID], Seq[Object]] found,
so Seq[Object] cannot be appended to Seq[sbt.ModuleID]
libraryDependencies ++= (Dependencies.backend)
                    ^
Run Code Online (Sandbox Code Playgroud)

Dal*_*and 14

短版(TL; DR)

出现错误common:您想要替换此行

"org.scalanlp.breeze-natives" % Version.breeze,
Run Code Online (Sandbox Code Playgroud)

用这条线

"org.scalanlp" %% "breeze-natives" % Version.beeze,
Run Code Online (Sandbox Code Playgroud)

长版

  1. "org.scalanlp.breeze-natives" % Version.breezeGroupArtifactID不是ModuleID.

  2. 这导致common成为一个Seq[Object]而不是一个Seq[ModuleID].

  3. 因此也是Dependencies.backend一个Seq[Object]

  4. 最终不能附加(via ++=)到libraryDependencies(定义为a SettingKey[Seq[ModuleID]]),因为没有可用的Append.Values[Seq[sbt.ModuleID], Seq[Object]].