mavenscoverage

How to exclude package from scoverage in maven


I am using scoverage-maven-plugin. What settings i need to provide in pom.xml to exclude package from scoverage.


Solution

  • This problem can be fixed by adding :

    <excludedPackages>your.package.here</excludedPackages> 
    

    inside the <configuration> tag in your "scoverage-maven-plugin".

    Below example can be seen for reference:

    <plugin>
           <groupId>org.scoverage</groupId>
           <artifactId>scoverage-maven-plugin</artifactId>
           <version>1.3.0</version>
           <configuration>
                 <excludedPackages>com.demoproject.utils</excludedPackages>
                 <scalaVersion>2.11.8</scalaVersion>
                 <highlighting>true</highlighting>
                 <minimumCoverage>90</minimumCoverage>
                 <failOnMinimumCoverage>true</failOnMinimumCoverage>
                 <aggregate>true</aggregate>
           </configuration>
     </plugin>