From ede615d71965e9aaa0c7019ecb05777f7ca905f2 Mon Sep 17 00:00:00 2001
From: Tathagata Das <tathagata.das1565@gmail.com>
Date: Fri, 22 Jun 2012 15:03:09 -0700
Subject: [PATCH] Fixed issues duplicate class issues in sbt assembly.

---
 project/SparkBuild.scala | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala
index 3830021aed..985de3cde3 100644
--- a/project/SparkBuild.scala
+++ b/project/SparkBuild.scala
@@ -65,16 +65,24 @@ object SparkBuild extends Build {
       "it.unimi.dsi" % "fastutil" % "6.4.4",
       "colt" % "colt" % "1.2.0"
     )
-  ) ++ assemblySettings ++ Seq(test in assembly := {})
+  ) ++ assemblySettings ++ extraAssemblySettings 
 
   def replSettings = sharedSettings ++ Seq(
     name := "spark-repl",
     libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _)
-  ) ++ assemblySettings ++ Seq(test in assembly := {})
+  ) ++ assemblySettings ++ extraAssemblySettings 
 
   def examplesSettings = sharedSettings ++ Seq(
     name := "spark-examples"
   )
 
   def bagelSettings = sharedSettings ++ Seq(name := "spark-bagel")
+
+  def extraAssemblySettings() = Seq(test in assembly := {}) ++ Seq(
+    mergeStrategy in assembly := { 
+      case m if m.toLowerCase.endsWith("manifest.mf") => MergeStrategy.discard 
+      case _ => MergeStrategy.first
+    }
+  ) 
+
 }
-- 
GitLab