scala - Conflicting files in uber-jar creation in SBT using sbt-assembly -


i trying compile , package fat jar using sbt , keep running following error. have tried using library dependency exclude , merging.

[trace] stack trace suppressed: run last *:assembly full output. [error] (*:assembly) deduplicate: different file contents found in     following: [error] /users/me/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1    .7.10.jar:meta-inf/maven/org.slf4j/slf4j-api/pom.properties [error] /users/me/.ivy2/cache/com.twitter/parquet-format/jars/parquet-format-2.2.0-rc1.jar:meta-inf/maven/org.slf4j/slf4j-api/pom.properties [error] total time: 113 s, completed jul 10, 2015 1:57:21 

the current incarnation of build.sbt file below:

import assemblykeys._  assemblysettings  name := "ldaapp"  version := "0.1"  scalaversion := "2.10.4"  mainclass := some("myapp")  librarydependencies +="org.scalanlp" %% "breeze" % "0.11.2"  librarydependencies +="org.scalanlp" %% "breeze-natives" % "0.11.2"  librarydependencies += "org.apache.spark" % "spark-mllib_2.10" % "1.3.1"  librarydependencies +="org.ini4j" % "ini4j" % "0.5.4"  jarname in assembly := "myapp"  net.virtualvoid.sbt.graph.plugin.graphsettings  librarydependencies += "org.slf4j" %% "slf4j-api"" % "1.7.10" % "provided" 

i realize doing wrong...i have no idea what.

here how can handle these merge issues.

import sbtassembly.plugin._  lazy val assemblysettings = sbtassembly.plugin.assemblysettings ++ seq(     publishartifact in packagescala := false, // remove scala uber jar     mergestrategy in assembly <<= (mergestrategy in assembly) { (old) =>         {             case pathlist("meta-inf", "changes.txt") => mergestrategy.first             // ...             case pathlist(ps @ _*) if ps.last endswith "pom.properties" => mergestrategy.first             case x => old(x)         }     } ) 

then add these settings project.

lazy val projecttojar = project(id = "myapp", base = file(".")).settings(assemblysettings: _*) 

Comments