这是我在Intellij上使用scala的火花sbt
version := "0.1"
scalaVersion := "2.11.11"
// https://mvnrepository.com/artifact/org.apache.spark/spark-graphx_2.10
libraryDependencies += "org.apache.spark" % "spark-graphx_2.10" % "2.1.0"
// https://mvnrepository.com/artifact/org.apache.spark/spark-sql_2.11
libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.1.0"
// https://mvnrepository.com/artifact/org.apache.spark/spark-core_2.11
libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.1.0"
我收到以下错误
[error] (*:update) Conflicting cross-version suffixes in:org.apache.spark:spark-launcher, org.json4s:json4s-ast, org.apache.spark:spark-network-shuffle, org.scalatest:scalatest, com.twitter:chill, org.json4s:json4s-jackson, com.fasterxml.jackson.module:jackson-module-scala, org.json4s:json4s-core,org.apache.spark:spark-unsafe, org.apache.spark:spark-tags, org.apache.spark:spark-core, org.apache.spark:spark-network-common
[error] (*:ssExtractDependencies) Conflicting cross-version suffixes in: org.apache.spark:spark-launcher, org.json4s:json4s-ast, org.apache.spark:spark-network-shuffle, org.scalatest:scalatest, com.twitter:chill, org.json4s:json4s-jackson, com.fasterxml.jackson.module:jackson-module-scala, org.json4s:json4s-core, org.apache.spark:spark-unsafe, org.apache.spark:spark-tags, org.apache.spark:spark-core, org.apache.spark:spark-network-common
任何人都可以让我知道如何纠正这个问题。对我来说,看起来spark-graphx与spark_core相矛盾。如何找到正确的SBT文件?或者我该怎么做才能使这个sbt文件正常工作。我可以降低graphx的版本以及spark,但更愿意降低spark的版本。
答案 0 :(得分:2)
在你的sbt文件中,依赖项称为spark-_。您在graphX依赖项中使用了不同的scala版本。
如果您使用Spark 2.x我建议使用scala 2.11,这样您只需要更改graphx依赖项。
libraryDependencies += "org.apache.spark" % "spark-graphx_2.11" % "2.1.0"
无论如何,您不需要在每个依赖项中编写scala版本。如果你写两个百分号符号%%,Sbt将根据scalaVersion值推断。 Here,您可以看到一个示例。