title: Exclude files in ant build
body: <p>I have the following ant file,</p>
  
  <pre><code>&lt;project&gt;
  &lt;path id="build-classpath"&gt;
      &lt;fileset dir="/opt/apache-tomcat-7.0.53/lib"&gt;
          &lt;include name="*.jar"/&gt;
      &lt;/fileset&gt;
      &lt;fileset dir="../../lib"&gt;
         &lt;include name="*.jar"/&gt;
      &lt;/fileset&gt;
      &lt;fileset dir="../../bin"&gt;
         &lt;include name="*.jar"/&gt;
      &lt;/fileset&gt;
  &lt;/path&gt;
  &lt;target name="compile"&gt;
    &lt;mkdir dir="classes"/&gt;
    &lt;mkdir dir="bin"/&gt;
    &lt;javac srcdir="src/" destdir="classes" includeantruntime="false"&gt;
      &lt;exclude name="/src/web/DaemonSocket.java"/&gt;
      &lt;classpath refid="build-classpath"/&gt;
    &lt;/javac&gt;
    &lt;javac srcdir="src/" destdir="bin" includeantruntime="false"&gt;
      &lt;classpath refid="build-classpath"/&gt;
    &lt;/javac&gt;
  &lt;/target&gt;
   &lt;target name="clean"&gt;
      &lt;delete dir="classes"/&gt;
      &lt;delete dir="bin"/&gt;
    &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>At the exclude line with the code,</p>
  
  <pre><code>  &lt;javac srcdir="src/" destdir="classes" includeantruntime="false"&gt;
      &lt;exclude name="/src/web/DaemonSocket.java"/&gt;
      &lt;classpath refid="build-classpath"/&gt;
    &lt;/javac&gt;
  </code></pre>
  
  <p>I expect the file <code>DaemonSocket.java</code> not to be compiled into the <code>classes</code> folder. However everytime I run <code>ant compile</code>, the <code>DaemonSocket.java</code> file is compiled into both the <code>classes</code> and the <code>bin</code> folder. Why might the <code>exclude</code> not be working in this case?</p>