title: How to define the order of executions using maven-assembly-plugin
body: <p>I am working on the migration of a project from Ant to Maven. The final distribution I need to deliver is a zip containing an executable jar with all its depencencies. Here is part of my pom:</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;version&gt;2.2-beta-4&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;finalName&gt;ProjectDistribution&lt;/finalName&gt;
                      &lt;appendAssemblyId&gt;false&lt;/appendAssemblyId&gt;              
                      &lt;descriptorRefs&gt;
                          &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;                            
                      &lt;/descriptorRefs&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;mainClass&gt;fullQualifiedNameToMainClass&lt;/mainClass&gt;
                              &lt;addClasspath&gt;true&lt;/addClasspath&gt;                               
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                      &lt;descriptors&gt;
                          &lt;descriptor&gt;${project.basedir}/src/main/assembly/dep.xml&lt;/descriptor&gt;
                      &lt;/descriptors&gt;                      
                  &lt;/configuration&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;jar-with-dependencies&lt;/id&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;single&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                      &lt;execution&gt;
                          &lt;id&gt;dist&lt;/id&gt;
                          &lt;phase&gt;assembly&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;single&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;                        
                  &lt;/executions&gt;                                       
              &lt;/plugin&gt;
  </code></pre>
  
  <p>And here is the assembly file:</p>
  
  <pre><code>&lt;assembly&gt;
  &lt;id&gt;dist&lt;/id&gt;
  &lt;formats&gt;
      &lt;format&gt;zip&lt;/format&gt;
  &lt;/formats&gt; 
  &lt;!-- 1st approach--&gt;
  &lt;!--files&gt;
      &lt;file&gt;
          &lt;source&gt;
              /target/ProjectDistribution.jar
          &lt;/source&gt;
          &lt;outputDirectory&gt;/&lt;/outputDirectory&gt;
      &lt;/file&gt;
  &lt;/files--&gt;
  &lt;fileSets&gt;
              &lt;!-- 2nd approach--&gt;        
      &lt;!--fileSet&gt;
          &lt;directory&gt;/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;fileSet&gt;
          &lt;directory&gt;/HelpFiles&lt;/directory&gt;
          &lt;outputDirectory&gt;&lt;/outputDirectory&gt;
          &lt;includes&gt;
              &lt;include&gt;*.*&lt;/include&gt;
          &lt;/includes&gt;
      &lt;/fileSet&gt;
  &lt;/fileSets&gt;
  </code></pre>
  
  <p></p>
  
  <p>I run 1.- mvn compile, 2.- mvn package, and 3.- mvn assembly:single</p>
  
  <p><strong>The problem I am dealing with is that</strong></p>
  
  <p>It does generate the jar with all the dependencies and it does generate the zip  but it does not includ the jar in the zip. I pretty much need to figure out a way of making the assembly first generate the jar and wait until it is created (because its size is 5 MB) and then create the zip. Right now the 1st and 2nd approaches -from the assembly file- are commented out, however, I have used both and none of them seem to work.</p>
  
  <p>Any help will be greatly appreciated!</p>
  
  <p>Eric</p>