title: How to check minimum code coverage for multi-module maven project with jacoco?
body: <p>I want to use <code>jacoco maven plugin</code> for checking minimum level of code coverage during build process using <code>'check'</code> goal. </p>
  
  <p>For one-module project everything works fine.
  But for multi-module I want to check average level of code coverage from all modules, but <code>check</code> goal checks every module separately. </p>
  
  <p>For example, <strong>module1</strong> has <strong>70%</strong> of code coverage, <strong>module2</strong> has <strong>100%</strong> code coverage, in average for all lines from both modules code coverage is <strong>85%</strong>.
  And I am trying to set code coverage for all project to 80%, but it fails because of first module.</p>
  
  <p>From pom:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.jacoco&lt;/groupId&gt;
      &lt;artifactId&gt;jacoco-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;0.7.6.201602180812&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;default-prepare-agent&lt;/id&gt;
              &lt;goals&gt;
                  &lt;goal&gt;prepare-agent&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
          &lt;execution&gt;
              &lt;id&gt;default-report&lt;/id&gt;
              &lt;phase&gt;prepare-package&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;report&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
          &lt;execution&gt;
              &lt;id&gt;default-check&lt;/id&gt;
              &lt;goals&gt;
                  &lt;goal&gt;check&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;rules&gt;
                      &lt;rule&gt;
                          &lt;element&gt;BUNDLE&lt;/element&gt;
                          &lt;limits&gt;
                              &lt;limit&gt;
                                  &lt;counter&gt;COMPLEXITY&lt;/counter&gt;
                                  &lt;value&gt;COVEREDRATIO&lt;/value&gt;
                                  &lt;minimum&gt;0.80&lt;/minimum&gt;
                              &lt;/limit&gt;
                          &lt;/limits&gt;
                      &lt;/rule&gt;
                  &lt;/rules&gt;
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>