title: Jacoco how to correctly exclude package
body: <p>I am using the Jacoco Maven plugin version 0.8.1 (With Java 8 / Maven 3.1.0).
  Cannot get Jacoco to work with path exclusions.
  I would like to exclude these packages :</p>
  
  <ul>
  <li><code>my.package.model</code></li>
  <li><code>my.package.exception</code></li>
  </ul>
  
  <p>What I tried :</p>
  
  <pre><code>&lt;build&gt;
        &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.jacoco&lt;/groupId&gt;
                  &lt;artifactId&gt;jacoco-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;0.8.1&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;prepare-agent&lt;/id&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;prepare-agent&lt;/goal&gt;
                          &lt;/goals&gt;  
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;excludes&gt;
                          &lt;exclude&gt;my.package.model&lt;/exclude&gt;
                          &lt;exclude&gt;my.package.exception&lt;/exclude&gt;
                      &lt;/excludes&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
        &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;reporting&gt;
          &lt;plugins&gt;
               &lt;plugin&gt;
                  &lt;groupId&gt;org.jacoco&lt;/groupId&gt;
                  &lt;artifactId&gt;jacoco-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;0.8.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;excludes&gt;
                          &lt;exclude&gt;my.package.model&lt;/exclude&gt;
                          &lt;exclude&gt;my.package.exception&lt;/exclude&gt;
                      &lt;/excludes&gt;
                  &lt;/configuration&gt;
                  &lt;reportSets&gt;
                      &lt;reportSet&gt;
                          &lt;reports&gt;
                              &lt;report&gt;report&lt;/report&gt;
                          &lt;/reports&gt;
                      &lt;/reportSet&gt;
                  &lt;/reportSets&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
  &lt;/reporting&gt;
  </code></pre>
  
  <p>And also (for the <code>excludes</code> part) :</p>
  
  <pre><code>&lt;excludes&gt;
       &lt;exclude&gt;my.package.model**&lt;/exclude&gt;
       &lt;exclude&gt;my.package.exception**&lt;/exclude&gt;
  &lt;/excludes&gt;
  
  &lt;excludes&gt;
       &lt;exclude&gt;my/package/model/**/*&lt;/exclude&gt;
       &lt;exclude&gt;my/package/exception/**/*&lt;/exclude&gt;
  &lt;/excludes&gt;
  
  &lt;excludes&gt;
       &lt;exclude&gt;*/my/package/model/**/*&lt;/exclude&gt;
       &lt;exclude&gt;*/my/package/exception/**/*&lt;/exclude&gt;
  &lt;/excludes&gt;
  
  &lt;excludes&gt;
       &lt;exclude&gt;**/my/package/model/**/*&lt;/exclude&gt;
       &lt;exclude&gt;**/my/package/exception/**/*&lt;/exclude&gt;
  &lt;/excludes&gt;
  
  &lt;excludes&gt;
       &lt;exclude&gt;**/my/package/model/**&lt;/exclude&gt;
       &lt;exclude&gt;**/my/package/exception/**&lt;/exclude&gt;
  &lt;/excludes&gt;
  
  &lt;excludes&gt;
       &lt;exclude&gt;**/my/package/model/*&lt;/exclude&gt;
       &lt;exclude&gt;**/my/package/exception/*&lt;/exclude&gt;
  &lt;/excludes&gt;
  
  &lt;excludes&gt;
       &lt;exclude&gt;**/model/*&lt;/exclude&gt;
       &lt;exclude&gt;**/exception/*&lt;/exclude&gt;
  &lt;/excludes&gt;
  
  &lt;excludes&gt;
       &lt;exclude&gt;**/model**&lt;/exclude&gt;
       &lt;exclude&gt;**/exception**&lt;/exclude&gt;
  &lt;/excludes&gt;
  </code></pre>
  
  <p>Impossible to remove these packages from the final report ... Frustrating.</p>
  
  <p>I read :</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/29887805/filter-jacoco-coverage-reports-with-gradle">Filter JaCoCo coverage reports with Gradle</a></li>
  <li><a href="https://stackoverflow.com/questions/25038034/jacoco-exclude-classes">Jacoco exclude classes</a></li>
  <li><a href="https://stackoverflow.com/questions/30042709/jacoco-exclude-classes-from-report">Jacoco exclude classes from report</a>
  ...</li>
  </ul>
  
  <p>Nothing work.</p>
  
  <p>Any idea ?</p>