title: Maven Shade plugin Merge MANIFEST.MD
body: <p>I have a lib whose <code>MANIFEST.MD</code> file contains certain classpath entries. I use this lib in my Project &amp; use maven-shade-plugin to make an uber-jar. In this process, the <code>MANIFEST.MD</code> contents of the lib are lost. </p>
  
  <p>My Lib MANIFEST File:</p>
  
  <pre><code>Manifest-Version: 1.0
  Archiver-Version: Plexus Archiver
  Built-By: pankajsinghal
  Class-Path: $JAVA_HOME/lib/ lib/commons-codec-1.9.jar lib/httpcore-4.4.1.jar
  Created-By: Apache Maven 3.5.4
  Build-Jdk: 1.8.0_181
  </code></pre>
  
  <p>When I create the uber-jar, it creates its own MANIFEST file with new content:</p>
  
  <pre><code>Manifest-Version: 1.0
  Archiver-Version: Plexus Archiver
  Built-By: pankajsinghal
  X-Compile-Target-JDK: 1.8
  Class-Path: conf/
  X-Compile-Source-JDK: 1.8
  Created-By: Apache Maven 3.5.4
  Build-Jdk: 1.8.0_181
  Main-Class: com.projectA.Main
  </code></pre>
  
  <p>How can I merge the lib's <code>MANIFEST.MD</code> content with the new <code>uber-jar</code>'s <code>MANIFEST.MD</code> file, so that the <code>Class-Path</code> entries of lib's MANIFEST are included in the uber-jar's MANIFEST file.</p>
  
  <p>I tried with the following transformer:  </p>
  
  <pre><code>&lt;transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"&gt;
      &lt;resource&gt;META-INF/MANIFEST.MF&lt;/resource&gt;
  &lt;/transformer&gt;
  </code></pre>
  
  <p>But, the build fails with the following message:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.0.0:shade (default) on project projectA: Error creating shaded jar: duplicate entry: META-INF/MANIFEST.MF -&gt; [Help 1]
  </code></pre>