title: Ant resource exists check
body: <p>I have problem testing file existence with ant. I want to check if files exist in target <code>test</code>, and if not, I want download files in target <code>download</code>. But the <code>download</code> target will be executed always (if files exist or not). Can anybody show what is wrong? </p>
  
  <pre><code>&lt;!-- Test lib files if exist --&gt;
  &lt;target name="test"&gt;
      &lt;condition property="is.resource.exists" value="true" else="false"&gt;
          &lt;and&gt;
              &lt;resourceexists&gt;
                  &lt;file file="${lib}/jdom-2.0.5.jar" /&gt;
              &lt;/resourceexists&gt;
              &lt;resourceexists&gt;
                  &lt;file file="${lib}/miglayout-4.0-swing.jar" /&gt;
              &lt;/resourceexists&gt;
          &lt;/and&gt;
      &lt;/condition&gt;
  &lt;/target&gt;
  
  &lt;!-- Download lib files if not exist --&gt;
  &lt;target name="download" if="is.resource.exists" depends="test"&gt;
      &lt;exec dir="${lib}" executable="${lib}/get-libs.sh" /&gt;
  &lt;/target&gt;
  </code></pre>