sbt-onejar icon indicating copy to clipboard operation
sbt-onejar copied to clipboard

Duplicate jars

Open kul opened this issue 11 years ago • 4 comments

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

kul avatar Mar 09 '13 06:03 kul

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?

xnickmx avatar Apr 29 '13 15:04 xnickmx

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

rmerlorangeknocks avatar May 14 '13 21:05 rmerlorangeknocks

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 ...

kul avatar May 15 '13 07:05 kul

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.

jeffrey-aguilera avatar May 13 '16 22:05 jeffrey-aguilera