title: Set directory in Maven Antrun Plugin
body: <p>I've downloaded jquery-ui to my webapp which has a <code>build.xml</code> for compressing and minifying.
  Now I would like to run this <code>build.xml</code> from within my <code>pom.xml</code>:</p>
  
  <pre><code>  &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;id&gt;compile&lt;/id&gt;
          &lt;phase&gt;compile&lt;/phase&gt;
          &lt;configuration&gt;
            &lt;target&gt;
              &lt;ant antfile="src/main/webapp/resources/js/jquery-ui/build/build.xml" /&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>But now the behavior for thi<code>s buildfile is wrong. It creates a dist folder on the wrong place. Here's the</code>build.xml` from jquery-ui: <a href="https://github.com/jquery/jquery-ui/blob/master/build/build.xml" rel="nofollow">https://github.com/jquery/jquery-ui/blob/master/build/build.xml</a></p>
  
  <p>It creates the dist folder on the same place where pom.xml is (same place i run <code>mvn clean package</code>) and it should create it in <code>src/main/webapp/resources/js/jquery-ui/build</code></p>
  
  <p>Is it possible to run <code>build.xml</code> from a specified directory (working directory)?
  Can't access the documentation for the Ant task: <a href="http://ant.apache.org/manual/CoreTasks/ant.html" rel="nofollow">http://ant.apache.org/manual/CoreTasks/ant.html</a></p>
  
  <p>EDIT: pom.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                               http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;com.example.myproject&lt;/groupId&gt;
    &lt;artifactId&gt;myproject&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
  
    &lt;name&gt;myproject&lt;/name&gt;
  
    &lt;dependencies&gt;
      &lt;!-- ... --&gt;
    &lt;/dependencies&gt;
  
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;configuration&gt;
            &lt;!-- ... --&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;configuration&gt;
            &lt;warName&gt;myproject&lt;/warName&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;install&lt;/id&gt;
              &lt;phase&gt;install&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;sources&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
          &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;phase&gt;compile&lt;/phase&gt;
              &lt;configuration&gt;
                &lt;executable&gt;make&lt;/executable&gt;
                &lt;workingDirectory&gt;src/main/webapp/resources/js/jquery&lt;/workingDirectory&gt;
              &lt;/configuration&gt;
              &lt;goals&gt;
                &lt;goal&gt;exec&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;phase&gt;compile&lt;/phase&gt;
              &lt;configuration&gt;
                &lt;target&gt;
                  &lt;ant antfile="build.xml" dir="src/main/webapp/resources/js/jquery-ui/build" /&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;
      &lt;/plugins&gt;
    &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>On running <code>mvn clean package</code> I'm getting the following errors in minify target of jquery-ui's build.xml:</p>
  
  <pre><code>[apply] build/minify-js.sh: Line 3: /home/danny/myproject/dist/jquery-ui-1.9pre/ui/minified/jquery-ui.min.js: File or directory not found
  </code></pre>
  
  <p>The correct path should be ${basedir}/src/main/webapp/resources/js/jquery-ui/build/dist/jquery-ui-1.9pre/ui/minified/jquery-ui.min.js instead of the above mentioned...</p>