title: Sonar exclusions/inclusions
body: <p>I'm trying to improve the coverage reports for my project and I want to exclude some packages <strong>BUT INCLUDING</strong> subpackages. For instance, I have this structure</p>
  
  <pre><code>src/main/java/com/myapp
      └ model
          └ mapper
              └ SomeMapperClass.java
          └ SomeModelClass.java --&gt; exclude this and others...
          └ ...
          └ ClassToInclude.java --&gt; but include this
      └ service
  </code></pre>
  
  <p>and I want to exclude <code>model</code> package but include <code>mapper</code> and <code>ClassToInclude</code>. Is there any way to do this without having to add every excluded class one by one? I would want something like this in <code>pom.xml</code>:</p>
  
  <pre><code>&lt;sonar.coverage.exclusions&gt;
      **/model/**/*.java
  &lt;/sonar.coverage.exclusions&gt;
  &lt;sonar.coverage.inclusions&gt;
      **/model/mapper/**/*.java
      **/model/ClassToInclude.java
  &lt;sonar.coverage.inclusions&gt;
  </code></pre>
  
  <p>Any help, guide, options and/or workarounds is appreciated. Thanks in advance for your answers.</p>
  
  <h2>UPDATE #1</h2>
  
  <p>I found a way to include the subpackages only using <code>sonar.coverage.exclusions</code> property by doing:</p>
  
  <pre><code>&lt;sonar.coverage.exclusions&gt;
      **/model/*.java
  &lt;/sonar.coverage.exclusions&gt;
  </code></pre>
  
  <p>With this you exclude every class in <code>model</code> but not in <code>model.mapper</code>. Now I just need a way to solve how to include specific class in an excluded package.</p>