sbt - Hadoop depends on two different versions of beanutils -
hadoop 2.4.0 depends on 2 different versions of beanutils, causing following error sbt-assembly
:
[error] (*:assembly) deduplicate: different file contents found in following: [error] .ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.7.0.jar:org/apache/commons/beanutils/basicdynabean.class [error] .ivy2/cache/commons-beanutils/commons-beanutils-core/jars/commons-beanutils-core-1.8.0.jar:org/apache/commons/beanutils/basicdynabean.class
both of these dependencies transitive hadoop 2.4.0, confirmed using how access ivy directly, i.e. access dependency reports or execute ivy commands?
how can make sbt-assembly including hadoop 2.4.0?
update: requested, here build.sbt dependencies:
librarydependencies += "org.apache.hadoop" % "hadoop-client" % "2.4.0" librarydependencies += "org.apache.spark" %% "spark-core" % "1.0.0" % "provided" exclude("org.apache.hadoop", "hadoop-client") resolvers += "akka repository" @ "http://repo.akka.io/releases/" librarydependencies += "com.amazonaws" % "aws-java-sdk" % "1.7.8" librarydependencies += "commons-io" % "commons-io" % "2.4" librarydependencies += "javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided" librarydependencies += "com.sksamuel.elastic4s" %% "elastic4s" % "1.1.1.0"
the exclude hadoop
needed because, out of box, spark includes hadoop 1, conflicts hadoop 2.
try add merge strategy build.sbt
like below
val meta = """meta.inf(.)*""".r mergestrategy in assembly <<= (mergestrategy in assembly) { (old) => { case pathlist("javax", "servlet", xs @ _*) => mergestrategy.last case pathlist("javax", "activation", xs @ _*) => mergestrategy.last case pathlist("org", "apache", xs @ _*) => mergestrategy.last case pathlist("com", "esotericsoftware", xs @ _*) => mergestrategy.last case pathlist("plugin.properties") => mergestrategy.last case meta(_) => mergestrategy.discard case x => old(x) } }
Comments
Post a Comment