Just ran into the same issue, according to sbt doc (
https://github.com/sbt/sbt-assembly#merge-strategy) you can specify merge
strategies for packages in sbt-assembly like that
assemblyMergeStrategy in assembly := {
case PathList("javax", "servlet", xs @ _*) => MergeStrategy.first
case PathList(ps @ _*) if ps.last endsWith ".html" => MergeStrategy.first
case "application.conf" => MergeStrategy.concat
case "unwanted.txt" => MergeStrategy.discard
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
So you can use MergeStrategy.first for leveldb
HtH
Vincent
2015-02-13 12:11 GMT+00:00 Patrik Nordwall <[email protected]>:
> I can confirm that leveldbjni-all.jar and leveldb-api contains some
> duplicate classes.
> What MergeStrategy do you use? Shuldn't MergeStrategy.deduplicate sort
> this out?
> I think you can define different merge strategies for different paths.
>
> /Patrik
>
> On Fri, Feb 6, 2015 at 12:06 PM, Eax Melanhovich <[email protected]> wrote:
>
>> Hello.
>>
>> I tried to build a fat jar using sbt-assembly plugin and got the
>> following error:
>>
>> [error] (robot/*:assembly) deduplicate: different file contents found in
>> the following:
>> [error]
>> /home/eax/.ivy2/cache/org.iq80.leveldb/leveldb-api/jars/leveldb-api-0.7.jar:org/iq80/leveldb/DB.class
>> [error]
>> /home/eax/.ivy2/cache/org.fusesource.leveldbjni/leveldbjni-all/bundles/leveldbjni-all-1.7.jar:org/iq80/leveldb/DB.class
>>
>> If I'm not mistaken both packages are dependencies of akka-persistent
>> (which is a dependency of akka-contrib which is used in our project). Here
>> is an output of sbt-dependency-graph plugin:
>>
>> [info] org.iq80.leveldb:leveldb-api:0.7
>> [info] +-org.fusesource.leveldbjni:leveldbjni:1.7
>> [info] | +-org.fusesource.leveldbjni:leveldbjni-all:1.7
>> [info] | |
>> +-com.typesafe.akka:akka-persistence-experimental_2.10:2.4-SNAPSHOT [S]
>> [info] | | +-com.typesafe.akka:akka-contrib_2.10:2.4-SNAPSHOT [S]
>>
>> There is no such issue with Akka 2.3.9. As far as I can see corresponding
>> bug is not reported at github so far.
>>
>> I wonder:
>>
>> 1. Is it really a bug in Akka or maybe I'm just doing something wrong?
>> 2. Is it OK that akka-contrib depends on an experimental package?
>>
>> --
>> Best regards,
>> Eax Melanhovich
>> http://eax.me/
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ:
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives:
>> https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> Patrik Nordwall
> Typesafe <http://typesafe.com/> - Reactive apps on the JVM
> Twitter: @patriknw
>
> [image: Scala Days] <http://event.scaladays.org/scaladays-sanfran-2015>
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
--
Vincent Van Steenbergen
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.