title: How to add prefix to Class-path MANIFEST entries with the Maven assembly plugin?
body: <p>I'm using the assembly plugin in Maven 3.x to create a tar ball that includes the project jars along with their dependencies. For convention I put the project jars on the root and all dependency jars under dir e.g.</p>
  
  <pre><code>├── hpcmom-cmaes-1.1.9-SNAPSHOT.jar
  └── lib
      ├── akka-actor_2.10-2.2.3.jar
      ├── akka-agent_2.10-2.2.3.jar
      ├── akka-kernel_2.10-2.2.3.jar
      ├── akka-remote_2.10-2.2.3.jar
      ├── akka-slf4j_2.10-2.2.3.jar
      ├── akka-zeromq_2.10-2.2.3.jar
  </code></pre>
  
  <p>The assembly that generates this is defined as:</p>
  
  <pre><code>&lt;assembly&gt;
      &lt;id&gt;cmaes-bin&lt;/id&gt;
      &lt;baseDirectory&gt;${pom.version}/hpcmom-cmaes&lt;/baseDirectory&gt;  
      &lt;formats&gt;
          &lt;format&gt;tar.gz&lt;/format&gt;
      &lt;/formats&gt;
      &lt;dependencySets&gt;
          &lt;dependencySet&gt;
              &lt;useProjectArtifact&gt;false&lt;/useProjectArtifact&gt;
              &lt;outputDirectory&gt;lib&lt;/outputDirectory&gt;
              &lt;unpack&gt;false&lt;/unpack&gt;
          &lt;/dependencySet&gt;
      &lt;/dependencySets&gt;
      &lt;fileSets&gt;
          &lt;fileSet&gt;
              &lt;directory&gt;&lt;/directory&gt;
              &lt;outputDirectory&gt;&lt;/outputDirectory&gt;
              &lt;includes&gt;
                  &lt;include&gt;README*&lt;/include&gt;
                  &lt;include&gt;LICENSE*&lt;/include&gt;
                  &lt;include&gt;COPYING*&lt;/include&gt;
                  &lt;include&gt;NOTICE*&lt;/include&gt;
              &lt;/includes&gt;
          &lt;/fileSet&gt;
          &lt;fileSet&gt;
              &lt;directory&gt;hpcmom-cmaes/target&lt;/directory&gt;
              &lt;outputDirectory&gt;&lt;/outputDirectory&gt;
              &lt;includes&gt;
                  &lt;include&gt;*.jar&lt;/include&gt;
              &lt;/includes&gt;
          &lt;/fileSet&gt;
      &lt;/fileSets&gt;
  &lt;/assembly&gt; 
  </code></pre>
  
  <p>But the <code>MANIFEST.MF</code> generated within <code>hpcmom-cmaes-1.1.9-SNAPSHOT.jar</code> does not generate the <code>./lib/</code> prefix only for the third-party dependencies but like if all jars were in the same folder. How can I modify the <code>MANIFEST.MF</code> via the assembly plugin so that the <code>lib</code> prefix is accounted for there.</p>
  
  <p>The generated Class-path <code>MANIFEST.MF</code> looks like this:</p>
  
  <pre><code> Class-Path: akka-actor_2.10-2.2.3.jar akka-agent_2.10-2.2.3.jar akka-kernel_2.10-2.2.3.jar akka-remote_2.10-2.2.3.jar akka-slf4j_2.10-2.2.3.jar akka-zeromq_2.10-2.2.3.jar
  </code></pre>
  
  <p>and the one I would like to get is:</p>
  
  <pre><code> Class-Path: lib/akka-actor_2.10-2.2.3.jar lib/akka-agent_2.10-2.2.3.jar lib/akka-kernel_2.10-2.2.3.jar lib/akka-remote_2.10-2.2.3.jar lib/akka-slf4j_2.10-2.2.3.jar lib/akka-zeromq_2.10-2.2.3.jar
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>The assembly plugin configuration looks like this in the parent pom.xml:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
      &lt;configuration&gt;
          &lt;descriptors&gt;                       
              &lt;descriptor&gt;src/main/assembly/cmaes-bin.xml&lt;/descriptor&gt;
              &lt;descriptor&gt;src/main/assembly/cmaes-src.xml&lt;/descriptor&gt;
          &lt;/descriptors&gt;
      &lt;archive&gt;
          &lt;manifest&gt;
              &lt;addClasspath&gt;true&lt;/addClasspath&gt;
              &lt;classpathPrefix&gt;lib/&lt;/classpathPrefix&gt;
          &lt;/manifest&gt;
      &lt;/archive&gt;                    
      &lt;/configuration&gt; 
  &lt;/plugin&gt;
  </code></pre>