以下是我最近添加到项目中的build.sbt文件的一部分,用于为应用程序构建API。
libraryDependencies ++= Seq(
"com.chuusai" %% "shapeless" % "2.3.1"
)
libraryDependencies ++= {
val sprayVersion = "1.3.1"
val akkaVersion = "2.3.4"
Seq(
"io.spray" % "spray-can" % sprayVersion,
"io.spray" % "spray-routing" % sprayVersion,
"io.spray" % "spray-testkit" % sprayVersion,
"io.spray" % "spray-client" % sprayVersion,
"io.spray" %% "spray-json" % "1.3.1",
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test",
"ch.qos.logback" % "logback-classic" % "1.0.12",
"org.scalatest" %% "scalatest" % "3.0.4" % "test"
)
}
虽然在导入库时会生成以下错误。
[error] (*:update) Conflicting cross-version suffixes in: com.chuusai:shapeless, com.typesafe.akka:akka-actor, com.typesafe.akka:akka-testkit
[error] (*:ssExtractDependencies) Conflicting cross-version suffixes in: com.chuusai:shapeless, com.typesafe.akka:akka-actor, com.typesafe.akka:akka-testkit
对于具有兼容性的合适库的建议非常受欢迎。我正在使用Spark 2.2.0,Scala 2.11.11。
答案 0 :(得分:0)
组合应该是:
libraryDependencies ++= Seq(
"com.chuusai" %% "shapeless" % "2.3.1"
)
libraryDependencies ++= {
val sprayVersion = "1.3.4"
val akkaVersion = "2.5.4"
Seq(
"io.spray" %% "spray-can" % sprayVersion,
"io.spray" %% "spray-routing" % sprayVersion,
"io.spray" %% "spray-testkit" % sprayVersion,
"io.spray" %% "spray-client" % sprayVersion,
"io.spray" %% "spray-json" % "1.3.3",
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test",
"ch.qos.logback" % "logback-classic" % "1.0.12",
"org.scalatest" %% "scalatest" % "3.2.0-SNAP7" % "test"
)
}