title: Execute Ant task with Maven
body: <p>I'm trying to execute with Maven some test written using Ant tasks. I generated the files required to import the task into Maven, but I can't execute them.</p>
  
  <p>My POM is defined this way:</p>
  
  <pre><code>&lt;build&gt;
    &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-ant-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.1&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;phase&gt;generate-sources&lt;/phase&gt;
              &lt;configuration&gt;
                &lt;tasks&gt;
                  &lt;echo message="Hello, maven"/&gt;
                &lt;/tasks&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;
  </code></pre>
  
  <p>I try to execute that message, but I get an error with run:</p>
  
  <pre><code>[ERROR] BUILD ERROR
  [INFO] ------------------------------------------------------------------------
  [INFO] 'run' was specified in an execution, but not found in the plugin
  </code></pre>
  
  <p>But, if I run: "mvn antrun:run", I know that this can not run the task.</p>
  
  <p>An if I've different targets, how do I call them from Maven? I've the pom.xml, and build.xml with the ant tasks.</p>
  
  <p>Thanks.</p>
  
  <p>Gonzalo</p>