How to make Sonar ignore some classes for codeCoverage metric?

后端 未结 8 1959
花落未央
花落未央 2020-12-08 09:18

I have a Sonar profile in Maven. Everything works fine except the code coverage metric. I want to make Sonar ignore some classes only for the code coverage metric. I have th

8条回答
  •  一个人的身影
    2020-12-08 09:56

    Sometimes, Clover is configured to provide code coverage reports for all non-test code. If you wish to override these preferences, you may use configuration elements to exclude and include source files from being instrumented:

    
        com.atlassian.maven.plugins
        maven-clover2-plugin
        ${clover-version}
         
             
                **/*Dull.java 
             
        
    
    

    Also, you can include the following Sonar configuration:

    
        
            **/domain/*.java,
            **/transfer/*.java
        
     
    

提交回复
热议问题