name := "pta-accuracy-ocean"
version := "0.0.1"
scalaVersion := "2.11.11"
libraryDependencies ++= Seq(
// Spark dependencies
"org.apache.spark" % "spark-hive_2.11" % "2.1.1",
"org.apache.spark" % "spark-mllib_2.11" % "2.1.1",
// Third-party libraries
"net.sf.jopt-simple" % "jopt-simple" % "4.3",
"com.amazonaws" % "aws-java-sdk" % "1.3.11",
"com.typesafe.play" %% "play-ahc-ws-standalone" % "1.0.0-M10"
)
这个“sbt程序集”构建得很好。现在我想使用Play WS Standalone。
所以我添加了以下库依赖项:
"com.typesafe.play" %% "play-ahc-ws-standalone" % "1.0.0-M10"
但我收到以下错误:
[error] Modules were resolved with conflicting cross-version suffixes in {file:/Users/paulreiners/dev/tv-insight-spark-scala/tv-pta-accuracy-ocean/}tv-pta-accuracy-ocean:
[error] org.apache.spark:spark-launcher _2.11, _2.10
[error] org.json4s:json4s-ast _2.11, _2.10
[error] org.apache.spark:spark-catalyst _2.11, _2.10
[error] org.apache.spark:spark-network-shuffle _2.11, _2.10
[error] com.typesafe.akka:akka-actor _2.10, _2.11
[error] com.twitter:chill _2.11, _2.10
[error] org.apache.spark:spark-sql _2.11, _2.10
[error] org.json4s:json4s-jackson _2.11, _2.10
[error] com.fasterxml.jackson.module:jackson-module-scala _2.11, _2.10
[error] org.json4s:json4s-core _2.11, _2.10
[error] org.apache.spark:spark-unsafe _2.11, _2.10
[error] org.apache.spark:spark-core _2.11, _2.10
[error] org.apache.spark:spark-network-common _2.11, _2.10
java.lang.RuntimeException: Conflicting cross-version suffixes in: org.apache.spark:spark-launcher, org.json4s:json4s-ast, org.apache.spark:spark-catalyst, org.apache.spark:spark-network-shuffle, com.typesafe.akka:akka-actor, com.twitter:chill, org.apache.spark:spark-sql, org.json4s:json4s-jackson, com.fasterxml.jackson.module:jackson-module-scala, org.json4s:json4s-core, org.apache.spark:spark-unsafe, org.apache.spark:spark-core, org.apache.spark:spark-network-common
at scala.sys.package$.error(package.scala:27)
at sbt.ConflictWarning$.processCrossVersioned(ConflictWarning.scala:46)
at sbt.ConflictWarning$.apply(ConflictWarning.scala:32)
at sbt.Classpaths$$anonfun$69.apply(Defaults.scala:1219)
at sbt.Classpaths$$anonfun$69.apply(Defaults.scala:1216)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (*:update) Conflicting cross-version suffixes in: org.apache.spark:spark-launcher, org.json4s:json4s-ast, org.apache.spark:spark-catalyst, org.apache.spark:spark-network-shuffle, com.typesafe.akka:akka-actor, com.twitter:chill, org.apache.spark:spark-sql, org.json4s:json4s-jackson, com.fasterxml.jackson.module:jackson-module-scala, org.json4s:json4s-core, org.apache.spark:spark-unsafe, org.apache.spark:spark-core, org.apache.spark:spark-network-common
我该如何解决这个问题?我已经尝试了太多的scalaVersion和libraryDependencies组合来列出。是否有一些有条不紊的方法来查找兼容的JAR?
请注意,虽然我希望尽可能使用最新的组合,但我不需要使用任何特别的Scala版本或任何特定的库版本。
答案 0 :(得分:0)
name := "ds-exactearth-pta-evaluation"
version := "1.0"
scalaVersion := "2.11.11"
javacOptions ++= Seq("-source", "1.7", "-target", "1.7")
// additional libraries
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % "1.3.1" % "provided",
"org.apache.spark" % "spark-sql_2.11" % "2.1.0",
"org.apache.spark" %% "spark-hive" % "1.3.1",
"org.apache.spark" %% "spark-streaming" % "1.3.1",
"org.apache.spark" %% "spark-streaming-flume" % "1.3.1",
"org.apache.spark" %% "spark-mllib" % "1.3.1",
"org.apache.commons" % "commons-lang3" % "3.0",
"org.eclipse.jetty" % "jetty-client" % "8.1.14.v20131031",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.3.3",
"org.elasticsearch" % "elasticsearch-hadoop-mr" % "2.0.0.RC1",
"net.sf.opencsv" % "opencsv" % "2.0",
"com.twitter.elephantbird" % "elephant-bird" % "4.5",
"com.twitter.elephantbird" % "elephant-bird-core" % "4.5",
"mysql" % "mysql-connector-java" % "5.1.31",
"com.github.scopt" %% "scopt" % "3.2.0",
"org.scalatest" %% "scalatest" % "2.2.1" % "test",
"com.typesafe.play" %% "play-ahc-ws-standalone" % "1.0.0-M9"
)