내가 너무 내 스파크 프로그램 수행을 배포 할 수있는 동네 짱 항아리를 구축을 위해 노력하고이 :스파크 2 SBT 조립을 중복 오류 스칼라 2.11.8
실행 : 이것은 많은 오류를 출력
sbt assembly
: 스칼라 2.10에 관한 질문에 대한
[error] deduplicate: different file contents found in the following:
[error] /Users/samibadawi/.ivy2/cache/commons-collections/commons-collections/jars/commons-collections-3.2.1.jar:org/apache/commons/collections/FastHashMap$CollectionView$CollectionViewIterator.class
[error] /Users/samibadawi/.ivy2/cache/commons-beanutils/commons-beanutils/jars/commons-beanutils-1.7.0.jar:org/apache/commons/collections/FastHashMap$CollectionView$CollectionViewIterator.class
대답은 작동하지 않았다 spark + sbt-assembly: "deduplicate: different file contents found in the following"
해킹이 끝나면 아래 build.sbt 파일을 사용하여 컴파일 할 유용한 코드가없는 hello world 프로젝트가 생겼습니다.
어떤 것이 배제되는지와 병합 전략이 무작위로 보입니다. 이를 위해보다 체계적이고 체계적인 방법이 있습니까?
(사용 게다가 : "org.apache.spark"%% "스파크 코어"%의 sparkVersion %의 "제공"어떠한 배포 의존성이없는 경우에는 .)build.sbt 발췌 :
import sbtassembly.AssemblyPlugin._
//Define dependencies. These ones are only required for Test and Integration Test scopes.
libraryDependencies ++= Seq(
("org.apache.spark" %% "spark-core" % sparkVersion).
exclude("commons-beanutils", "commons-beanutils-core").
exclude("commons-collections", "commons-collections").
exclude("commons-logging", "commons-logging").
exclude("com.esotericsoftware.minlog", "minlog").
exclude("com.codahale.metrics", "metrics-core").
exclude("aopalliance","aopalliance")
,
"org.scalatest" %% "scalatest" % "2.2.4" % "test,it"
)
mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) =>
{
case PathList("javax", "servlet", xs @ _*) => MergeStrategy.last
case PathList("javax", "inject", xs @ _*) => MergeStrategy.last
case PathList("javax", "activation", xs @ _*) => MergeStrategy.last
case PathList("org", "apache", xs @ _*) => MergeStrategy.last
case PathList("com", "google", xs @ _*) => MergeStrategy.last
case PathList("com", "esotericsoftware", xs @ _*) => MergeStrategy.last
case PathList("com", "codahale", xs @ _*) => MergeStrategy.last
case PathList("com", "yammer", xs @ _*) => MergeStrategy.last
case "about.html" => MergeStrategy.rename
case "META-INF/ECLIPSEF.RSA" => MergeStrategy.last
case "META-INF/mailcap" => MergeStrategy.last
case "META-INF/mimetypes.default" => MergeStrategy.last
case "plugin.properties" => MergeStrategy.last
case "log4j.properties" => MergeStrategy.last
case x => old(x)
}
}
Project.inConfig(Test)(assemblySettings)