title: Maven + Cobertura : Unable to locate [Your Class]. Have you specified the source directory?
body: <p>I have "MyMath" class with 2 simple methods: "multi" and "add".
  And test class which will only test multi method.</p>
  
  <pre><code>public class MainTest {
  
      @Test
      public void testMultiply() {
  
         MyMath tester = new MyMath();
  
         // check if multiply(10,5) returns 50
         assertEquals("10 x 5 must be 50", 50, tester.multi(10, 5));
       } 
  }
  </code></pre>
  
  <p>My project structure is:</p>
  
  <pre><code>JenkinsTest/
   src/
    main/Main.java
    math/MyMath.java
    test/MathTest.java
  </code></pre>
  
  <p>And pom.xml at root of project.
  I am trying to generate coverage report using cobertura-maven-plugin.</p>
  
  <pre><code>&lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
          &lt;artifactId&gt;cobertura-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.6&lt;/version&gt;
          &lt;configuration&gt;
            &lt;formats&gt;
             &lt;format&gt;html&lt;/format&gt;
             &lt;format&gt;xml&lt;/format&gt;
            &lt;/formats&gt;
          &lt;/configuration&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;goals&gt;
                &lt;goal&gt;clean&lt;/goal&gt;
                &lt;goal&gt;check&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;  
  
  &lt;dependencies&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.8.1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>And run maven from command line <code>maven cobertura:cobertura</code></p>
  
  <p>It says 1 Test is run, Cobertura Report generation was successful, Build Success messages. But when I go check target/site/cobertura/index.html, it says "MyMath" class has 100% line coverage (Even though "add" method is not executed). When I click on "MyMath" link, it says "Unable to locate math/MyMath.java. Have you specified the source directory?". I am newbie to Maven and cobertura. Can somebody please kindly guide me to show the coverage result correctly and "Unable to locate" problem. Thank you.</p>
  
  <p>PS: I changed the project structure to Maven Standard Directory Layout as @drembert advice and it works as excepted. But when I clicked the class name, the error: "Unable to locate <strong>main/java/MyMath.java</strong>. Have you specified the source directory?" is still there.</p>