title: ant : jar and zipfileset - copy files from one JAR into another
body: <p>I am currently doing this:</p>
  
  <pre><code>&lt;jar update="yes"
       jarfile="${pwd}/dist/${release}_installer.jar"&gt;
     &lt;zipfileset src="${pwd}/dist/app.jar" includes="com/izforge/izpack/panels/**"/&gt;
     &lt;zipfileset src="${pwd}/dist/app.jar" includes="com/xyz/img/logo.png"/&gt;
  &lt;/jar&gt;
  </code></pre>
  
  <p>My existing installer JAR gets updated to include the files as needed, extracted from the app JAR.</p>
  
  <p>So far, so good.</p>
  
  <p>However, I want to modify the behaviour such that the path of the image file is different than what is being copied from:</p>
  
  <p>Currently:</p>
  
  <pre><code>com/izforge/izpack/panels/MyIzPanel.class
  com/xyz/img/logo.png
  </code></pre>
  
  <p>What I want:</p>
  
  <pre><code>com/izforge/izpack/panels/MyIzPanel.class
  blah/img/logo.png
  </code></pre>
  
  <p>So I need to copy the files, but use <a href="http://ant.apache.org/manual/Types/zipfileset.html" rel="nofollow noreferrer"><code>&lt;zipfileset&gt;</code></a> and <a href="http://ant.apache.org/manual/Tasks/jar.html" rel="nofollow noreferrer"><code>&lt;jar&gt;</code></a> in such a way that I can modify the directory structure.</p>
  
  <p>Is there a way to do this, apart from unzipping the entire contents copying file and then zipping it back up again?</p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>Link to earlier related question: <a href="https://stackoverflow.com/questions/2521231/ant-task-to-remove-files-from-a-jar">ant task to remove files from a jar</a></p>