gpt4 book ai didi

scala - SBT 不能将 Seq[Object] 附加到 Seq[ModuleID]

转载 作者:行者123 更新时间:2023-12-04 16:39:19 27 4
gpt4 key购买 nike

SBT 因不正确的附加错误而不断失败。我使用了我见过很多次的构建文件的确切格式。

构建.sbt:

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

依赖.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")

我不太明白 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)
^

最佳答案

短版 (TL;DR)
common 中存在错误: 你想替换这一行

"org.scalanlp.breeze-natives" % Version.breeze,

用这条线
"org.scalanlp" %% "breeze-natives" % Version.beeze,

长版
  • "org.scalanlp.breeze-natives" % Version.breezeGroupArtifactID不是 ModuleID .
  • 这会导致 common成为Seq[Object]而不是 Seq[ModuleID] .
  • 因此还有 Dependencies.backend成为 Seq[Object]
  • 最终不能(通过 ++= )附加到 libraryDependencies (定义为 SettingKey[Seq[ModuleID]] )因为没有可用的 Append.Values[Seq[sbt.ModuleID], Seq[Object]] .
  • 关于scala - SBT 不能将 Seq[Object] 附加到 Seq[ModuleID],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29311341/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com