sbt / sbt-onejar

Packages your project using One-JAR™
MIT License
268 stars 45 forks source link

Duplicate jars #17

Open kul opened 11 years ago

kul commented 11 years ago

IMO having duplicate jars is pretty common for a moderately sized project. with sbt one-jar i get this error. I do not seem to find any help to avoid this.

[error] ...*:one-jar: java.util.zip.ZipException: duplicate entry: lib/slf4j-log4j12-1.6.1.jar

Thanks

xnickmx commented 11 years ago

I am having a similar problem:

[error] (*:one-jar) java.util.zip.ZipException: duplicate entry: lib/slf4j-api-1.6.1.jar

Any tips on how to avoid this?

rmerlorangeknocks commented 11 years ago

If you have the jar in lib/ but the dependency also in your build.sbt you'll get this error. Hopefully that'll help

kul commented 11 years ago

I did something like this in my Build.scala file, Though its not ideal

lazy val Javax = """javax/servlet/.*""".r .... mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) =>
{
case Javax() => MergeStrategy.first ...

jeffrey-aguilera commented 8 years ago

Just started playing with sbt-onejar as an alternative to sbt-assembly. Immediately hit this three year old bug ... Guess I will revisit sbt-onejar again in a few years, as this seems to be the pace of improvement. sbt-onejar should not die when trying to add multiple identical copies of a jar to a project.