title: Run an ant task in maven build phase before war is packaged?
body: <p>When deploying a webapp I need to update some variables in UI resources, unzip some assets and concat some files, currently this is achieved via an ant task. I'm trying to run this task in the maven build process using something like this... </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.6&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;deploy-ui&lt;/id&gt;
              &lt;phase&gt;prepare-package&lt;/phase&gt;
              &lt;inherited&gt;false&lt;/inherited&gt;
              &lt;configuration&gt;
                  &lt;target&gt;
                      &lt;property name="buildDir" value="${project.build.directory}/${project.build.finalName}" /&gt;
                      &lt;ant antfile="build.xml" target="static-assets" /&gt;
                  &lt;/target&gt;
              &lt;/configuration&gt;
              &lt;goals&gt;
                  &lt;goal&gt;run&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>The above fails because the files have not yet been copied into target directory. If I set the phase to "package" the ant task runs fine and all the files are created/amended, but it's no help as the .war has already been built before the ant target is run. </p>
  
  <p>Basically, I need to run my ant target near the end of the prepare-package phase. </p>
  
  <p>Having looked though the <a href="http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference">Lifecycle Reference</a> I can't workout how to expose the more granular Goals to the antrun plugin.  </p>
  
  <p>Any ideas? </p>