title: Preserving Manifest.mf when building via sbt assembly
body: <p>When I build my project using <code>sbt assembly</code>, I get <code>java.util.zip.ZipException: duplicate entry: META-INF/MANIFEST.MF</code>. The solution that google recommends, is to use <code>MergeStrategy.discard</code>. </p>
  
  <p>That works in getting the project to build - but it crashes at runtime, because Dropwizard (a dependency) relies on info contained in manifest.mf (full issue details: <a href="https://github.com/dropwizard/dropwizard/issues/455" rel="nofollow noreferrer">https://github.com/dropwizard/dropwizard/issues/455</a> ).</p>
  
  <p>The recommendation when encountering that error, is to merge the manifests.</p>
  
  <p>I've tried all the MergeStrategies on Manifest.MF that seem like they'd do the trick (<code>filterDistinctLines</code>, <code>concat</code>, <code>first</code>, <code>last</code>), they all cause the build to fail with <code>java.util.zip.ZipException: duplicate entry: META-INF/MANIFEST.MF</code>. The only thing that compiles is <code>discard</code>, but that causes the program to crash at runtime due to Dropwizard relying on the mf file.</p>
  
  <p>Any ideas what to do here? Is there a way to merge the manifests as described in the comments at <a href="https://github.com/dropwizard/dropwizard/issues/455" rel="nofollow noreferrer">https://github.com/dropwizard/dropwizard/issues/455</a> ?</p>