SBT assembly : MergeStrategy error

560 views
Skip to first unread message

Ram

unread,
Oct 26, 2013, 7:37:31 PM10/26/13
to simple-b...@googlegroups.com
I have included sbt assembly to my sbt. 

I have set retrieveManaged := true. When I run sbt assembly, I get this error - 

java.lang.RuntimeException: deduplicate: different file contents found in the following:
/home/user/parse/scala/AnonApp/lib_managed/jars/org.mortbay.jetty/servlet-api/servlet-api-2.5-20081211.jar:javax/servlet/SingleThreadModel.class
/home/user/parse/scala/AnonApp/lib_managed/orbits/org.eclipse.jetty.orbit/javax.servlet/javax.servlet-2.5.0.v201103041518.jar:javax/servlet/SingleThreadModel.class

Seeing this error, as per README in github, I have MergeStrategy like, 

To exclude the javax library while merging, but it doesn't seem to help. 

mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) =>
  {
    case PathList("javax", "servlet", xs @ _*)         => MergeStrategy.discard
    case PathList(ps @ _*) if ps.last endsWith ".html" => MergeStrategy.discard
    case "application.conf" => MergeStrategy.concat
    case "unwanted.txt"     => MergeStrategy.discard
    case x => old(x)
  }
}



How do I workaround the issue, any help would be appreciated! Thanks!



Seth Tisue

unread,
Oct 27, 2013, 9:56:06 AM10/27/13
to simple-b...@googlegroups.com
already answered at
http://stackoverflow.com/questions/19606243/sbt-assembly-mergestrategy-error

(Note that if you ask the same question in two different places on the
Internet, it's considered polite to say so and link to the other
place, so that someone doesn't waste time answering a question in
place A that's already been answered in place B.)
Reply all
Reply to author
Forward
0 new messages