I am trying to build a JAR file through SBT, with my driver script being in Scala. However, when I run 'sbt assembly' I receive a large slew of:
deduplicate: different file contents found in the following:
The entire list of directories displaying that message is too large to post here, so I attached a screenshot which you can view below. My build file contains the following:
libraryDependencies ++= Seq("org.apache.spark" %% "spark-core" % "2.0.0" % "provided", "org.apache.spark" %% "spark-mllib" % "2.0.0")
I attempted the solution offered by Onilton Maciel to this question, but to no avail. I am also confused as to how to implement the solution offered by Martin Senne, as the setup instructions on the 'Setup' section for the Assembly plugin are not clear on how to implement his code snippet. Any help would be appreciated. Thanks
Solved
as the setup instructions on the 'Setup' section for the Assembly plugin are not clear on how to implement his code snippet.
It means you should add merge strategy in build.sbt
or in root directory sbt files.
There is an example from sbt-assembly official document and update it with your conflicts:
import sbtassembly.MergeStrategy
assemblyMergeStrategy in assembly := {
case PathList("org", "apache", "hadoop", "yarn", "factories", "package-info.class") => MergeStrategy.discard
case PathList("org", "apache", "hadoop", "yarn", "provider", "package-info.class") => MergeStrategy.discard
case PathList("org", "apache", "hadoop", "util", "provider", "package-info.class") => MergeStrategy.discard
case PathList("org", "apache", "spark", "unused", "UnusedStubClass.class") => MergeStrategy.first
}
Hopeful it's helpful for you.
No comments:
Post a Comment