title: How to execute tasks conditionally using the maven-antrun-plugin?
body: <p>I need to execute some ant commands depending on an environment variable passed in as a parameter to the maven build command.</p>
  
  <p>At the moment I have 3 tasks blocks and only the tasks block with no condition is being executed.</p>
  
  <pre><code>&lt;tasks name="isProdCheck"&gt;
    &lt;condition property="isProd"&gt;
      &lt;equals arg1="${environment}" arg2="PROD" /&gt;
    &lt;/condition&gt;
  &lt;/tasks&gt;
  
  &lt;tasks if="isProd" depends="isProdCheck"&gt;
  ...
  &lt;/tasks&gt;
  
  &lt;tasks&gt;
  ... I am the only block executed
  &lt;/tasks&gt;
  </code></pre>
  
  <p>What am I doing wrong, is there a better way to do this?</p>