Re: [sbt] SBT Assembly Problem

1,904 views
Skip to first unread message

Kristian Domagala

unread,
Mar 4, 2013, 6:07:09 PM3/4/13
to simple-b...@googlegroups.com
Yes, it sounds like at least one of the jars has a MANIFEST.MF file. Take a look at <https://github.com/sbt/sbt-assembly#merge-strategy> for options on how to resolve the issue.

Cheers,
Kristian.

On Sat, Mar 2, 2013 at 9:06 AM, Michael Schmitz <sch...@gmail.com> wrote:
Hi, I'm trying to make an sbt assembly.

> sbt assembly
...
[info] Packaging blahblah-1.0.0-SNAPSHOT.jar ...
java.util.zip.ZipException: duplicate entry: META-INF/MANIFEST.MF

Am I getting this because one of the dependencies supplies a MANIFEST.MF already?  How can I avoid that file?  Or am I having a different problem?

Is the sbt assembly program the best way to get a fat jar?

Thanks!

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simple-build-t...@googlegroups.com.
To post to this group, send email to simple-b...@googlegroups.com.
Visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Michael Schmitz

unread,
Mar 5, 2013, 12:45:19 PM3/5/13
to simple-b...@googlegroups.com
Thank you for your answer.  From a knowledgeable perspective it probably looks like I hadn't read about merge strategies--but really it was just a lot to take and your confirmation gave me the focus to read again, read more, and understand.

This is what I ended up using.

mergeStrategy in assembly := {
  case PathList("META-INF", xs @ _*) =>
    (xs map {_.toLowerCase}) match {
      case ("manifest.mf" :: Nil) | ("index.list" :: Nil) | ("dependencies" :: Nil) => MergeStrategy.discard
      case _ => MergeStrategy.discard
    }
  case _ => MergeStrategy.first
}

Peace.  Michael

Ismail Kelebek

unread,
Feb 23, 2015, 8:32:53 PM2/23/15
to simple-b...@googlegroups.com
Your last two lines are different from the merge strategies sbt offers but your lines seems to work.   
Reply all
Reply to author
Forward
0 new messages