title: How to create and include a zip file inside a tar using maven assembly plugin
body: <p>I have a project which is using a maven assembly plugin to include a bunch of files into a tar. Now I want to include a few more files in that tar, but first I want to zip them up and actually include that zip file.</p>
  
  <p>I tried doing something like this: <a href="https://stackoverflow.com/questions/1522778/maven-assembly-plugin-how-to-create-nested-assemblies">maven-assembly plugin - how to create nested assemblies</a></p>
  
  <p>So basically created 2 executions inside the maven assempbly plugin and have the first execution create the required zip file that the second execution can package into a tar.</p>
  
  <p>But I get the error saying the zip file 'is not a file'.</p>
  
  <p>What is wrong with what I am doing?<br>
  Is there a more efficient way to do this?</p>
  
  <p>This is what I tried:<br>
  My POM:</p>
  
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;create-zip&lt;/id&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;single&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;descriptors&gt;
                                  &lt;descriptor&gt;zip.xml&lt;/descriptor&gt;
                              &lt;/descriptors&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                      &lt;execution&gt;
                          &lt;id&gt;create-tar&lt;/id&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;single&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                          &lt;descriptors&gt;
                              &lt;descriptor&gt;tar.xml&lt;/descriptor&gt;d
                          &lt;/descriptors&gt;
                  &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt; 
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>zip.xml</p>
  
  <pre><code>&lt;assembly xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
        xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"&gt;
  &lt;id&gt;zip-id&lt;/id&gt;
  &lt;formats&gt;
      &lt;format&gt;zip&lt;/format&gt;
  &lt;/formats&gt;
  &lt;includeBaseDirectory&gt;false&lt;/includeBaseDirectory&gt;
  &lt;fileSets&gt;
      &lt;fileSet&gt;
        &lt;directory&gt;${project.basedir}/src/main/resources/vertica_schema/schema_migrations&lt;/directory&gt;
       &lt;outputDirectory&gt;/&lt;/outputDirectory&gt;
      &lt;/fileSet&gt;
  &lt;/fileSets&gt;
  </code></pre>
  
  <p></p>
  
  <p>tar.xml</p>
  
  <pre><code>&lt;assembly xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://maven.apache.org/plugins/maven-assembly-  plugin/assembly/1.1.2"
        xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"&gt;
  &lt;id&gt;tar-id&lt;/id&gt;
  &lt;formats&gt;
      &lt;format&gt;tar.gz&lt;/format&gt;
  &lt;/formats&gt;
  &lt;includeBaseDirectory&gt;false&lt;/includeBaseDirectory&gt;
  &lt;files&gt; 
      &lt;file&gt;
          &lt;source&gt;/*.zip&lt;/source&gt;
          &lt;outputDirectory&gt;/lib&lt;/outputDirectory&gt;
          &lt;destName&gt;schema_migrations.zip&lt;/destName&gt;
      &lt;/file&gt;
  &lt;/files&gt; 
  </code></pre>
  
  <p></p>