title: Cobertura showing 0% coverage
body: <p>I'm using Cobertura 1.9.3 with NetBeans 6.8, Ant 1.7.1 and JDK 1.6.0_21 running with -WAR, and EJB, JUnit 4 tests.</p>
  
  <p>When I change the line <code>pathelement location="${build.classes.dir}" /</code> to <code>pathelement location="${build.test.classes.dir}" /</code>, there is some coverage (albeit in the wrong classes, it shouldn't be in the testclass, just to show that the environment and .jar locations are set correctly) shown in the html reports.</p>
  
  <p>However, when I change it back to <code>pathelement location="${build.classes.dir}" /</code>, I always get 0% coverage.</p>
  
  <p>fwiw, when the instrumentation folders do contain instrumented classes in <code>${build.instrumented.dir}</code> (these classes are slightly larger than the ones in the <code>${build.classes.dir}</code> location). And yes, I've retried after deleting <code>cobertura.ser</code> from the previous run.</p>
  
  <p>Could I please have a clue on what's wrong?</p>
  
  <p>Cheers,</p>
  
  <p>Snippet of <code>build.xml</code> in a <code>-ejb</code> folder.</p>
  
  <pre><code>           &lt;property environment="env"/&gt;
             &lt;path id="cobertura.class.path"&gt;
                 &lt;fileset dir="${build.dir}/../../lib"&gt;
                     &lt;include name="**/*.jar"/&gt;
                 &lt;/fileset&gt;
             &lt;/path&gt;
             &lt;taskdef classpathref="cobertura.class.path" resource="tasks.properties"/&gt;
  
             &lt;target name="-pre-compile-test"&gt;
                 &lt;delete dir="${build.instrumented.dir}" /&gt;
                 &lt;delete dir="${build.report.cobertura.dir}" /&gt;
                 &lt;mkdir dir="${build.instrumented.dir}" /&gt;
                 &lt;mkdir dir="${build.report.cobertura.dir}" /&gt;
                 &lt;cobertura-instrument todir="${build.instrumented.dir}" classpathref="cobertura.class.path"&gt;
                     &lt;ignore regex="org.apache.log4j.*" /&gt;
                     &lt;includeClasses regex=".*" /&gt;
                     &lt;excludeClasses regex=".*\.Test.*" /&gt;
                     &lt;excludeClasses regex=".*\.TestSuite.*" /&gt;
  
                     &lt;instrumentationClasspath&gt;
                         &lt;pathelement location="${build.classes.dir}" /&gt;
                     &lt;/instrumentationClasspath&gt;
                 &lt;/cobertura-instrument&gt;
             &lt;/target&gt;
  
             &lt;target name="-post-test-run"&gt;
                 &lt;cobertura-report format="html" srcdir="${src.dir}" destdir="${build.report.cobertura.dir}"/&gt;
                 &lt;cobertura-report format="xml" srcdir="${src.dir}" destdir="${build.report.cobertura.dir}"/&gt;
             &lt;/target&gt;
  </code></pre>
  
  <p>===</p>
  
  <p>Edit: I also have the following set up:</p>
  
  <pre><code>        ...
          build.test.classes.dir=${build.dir}/test/classes
          build.test.results.dir=${build.dir}/test/results
          build.instrumented.dir=${build.dir}/instrumented
          build.report.dir=${build.dir}/report
          build.report.cobertura.dir=${build.report.dir}/cobertura
          ...
          javac.classpath=\
          ${libs.GlassFish_v3.classpath}:\
          ${file.reference.mysql-connector-java-5.1.13-bin.jar}
          ...
          javac.test.classpath=\
          ${javac.classpath}:\
          ${file.reference.mysql-connector-java-5.1.13-bin.jar}:\
          ${libs.Libraries_Needed_For_JUnit.classpath}:\
          ${build.instrumented.dir}:\
          ${build.classes.dir}:\
          ${libs.junit_4.classpath}
          ...
          run.test.classpath=\
          ${javac.test.classpath}:\
          ${file.reference.mysql-connector-java-5.1.13-bin.jar}:\
          ${libs.Cobertura.classpath}:\
          ${libs.Libraries_Needed_For_JUnit.classpath}:\
          ${libs.junit_4.classpath}:\
          ${build.test.classes.dir}
          ...
          src.dir=${source.root}/java
          test.src.dir=test
  </code></pre>