title: Failed to getClass for org.jacoco.maven.AgentMojo - Jenkins fails to build with JaCoCo maven plugin but works locally
body: <p>I've added <code>JaCoCo</code> plugin to my <code>Maven</code> plugins, and can generate coverage report successfully locally.</p>
  
  <p>However after I've commited the changed <code>pom.xml</code> and <code>Jenkins</code> tries to build the <code>Maven</code> project (consisting of multiple modules) the build fails with the output like this:</p>
  
  <pre><code>[HUDSON] Collecting dependencies info
  [HUDSON] Collecting dependencies info
  [HUDSON] Collecting dependencies info
  [HUDSON] Collecting dependencies info
  [JENKINS] Recording test results
  [WARNING] Failed to getClass for org.jacoco.maven.AgentMojo
  [JENKINS] Archiving /var/lib/jenkins/jobs/xy xyz1
  [JENKINS] Archiving /var/lib/jenkins/jobs/xy xyz2
  [JENKINS] Archiving /var/lib/jenkins/jobs/xy xyz3
  [JENKINS] Archiving /var/lib/jenkins/jobs/xy xyz4
  channel stopped
  Finished: FAILURE
  </code></pre>
  
  <p>The only warning I get is the <code>Failed to getClass for org.jacoco.maven.AgentMojo</code> so I assume this could cause the build failure.</p>
  
  <p>First I've thought that it's because a proxy setting, but I've added the same <code>settings.xml</code> to the <code>Jenkins</code> build as I use locally (with which the plugin is used successfully).</p>
  
  <p>Also I've tried to look up this specific error in several places with no luck.</p>
  
  <p>Also tried to change the pom executions, but since it's working locally I think there's no reason in changing the following Maven pom.xml setting:</p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.jacoco&lt;/groupId&gt;
              &lt;artifactId&gt;jacoco-maven-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;prepare-agent&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;post-unit-test&lt;/id&gt;
                      &lt;phase&gt;test&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;report&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>Why Jenkins does not log any more errors than that simple <code>[WARNING]</code> line?</p>
  
  <p>What can be the reason <code>Jenkins</code> fails to <code>getClass</code> while locally the <code>Maven</code> build runs successfully?</p>
  
  <p>Can I get <code>JaCoCo</code> coverage without adding the maven plugin to the xml? (From what I've found it is needed to be added for getting to work the <code>Jenkins</code> plugin)</p>