Jacoco exclude classes

前端 未结 3 980
迷失自我
迷失自我 2021-01-20 22:08

Hi I am trying to exclude classes for my code coverage using jacoco. I want to exclude the gui folder and all the classes inside it.

            


        
3条回答
  •  梦毁少年i
    2021-01-20 23:04

    We can exclude the class from coverage checking (i.e. fail the build if the coverage doesn't meet the target), but not exclude them from the reporting (i.e. you can still see the class in the report). Is it what you after?

    If you would like to exclude the classes from checking, you could try the following config, and please use com.project.folder.tools.gui.* pattern without the slash and trailing suffix.

    
        org.jacoco
        jacoco-maven-plugin
        
            
                check
                
                    check
                
                
                true
                
                    
                        CLASS
                        
                            com.example.className
                            com.example.config.*
                        
                        
                            
                                LINE
                                COVEREDRATIO
                                0.80
                            
                        
                    
                
                
             
         
     
    

    Check this offical doco for detail

提交回复
热议问题