Maven Jacoco Configuration - Exclude classes/packages from report not working

前端 未结 7 2089
傲寒
傲寒 2020-11-28 21:00

I have a maven multi-module project and I\'m using jacoco-maven for code coverage reports. Some classes should not be reported, as they\'re Spring configuration and I\'m not

7条回答
  •  猫巷女王i
    2020-11-28 21:36

    Though Andrew already answered question with details , i am giving code how to exclude it in pom

               
                    org.jacoco
                    jacoco-maven-plugin
                    0.7.9
                    
                        
                            **/*com/test/vaquar/khan/HealthChecker.class
                        
                    
                    
                        
                        
                            jacoco-initialize
                            
                                prepare-agent
                            
                        
                        
                            jacoco-site
                            package
                            
                                report
                            
                        
                    
                
    

    For Springboot application

    
            
                
                    org.springframework.boot
                    spring-boot-maven-plugin
                
                
                    org.apache.maven.plugins
                    maven-surefire-plugin
                
                
                    org.codehaus.mojo
                    sonar-maven-plugin
                
                
                    org.sonarsource.scanner.maven
                    sonar-maven-plugin
                
                
                    org.jacoco
                    jacoco-maven-plugin
                    
                        
                           
                            **/*com/khan/vaquar/Application.class
                            
                            **/*com/khan/vaquar/config/**
                        
                    
                
            
        
    

提交回复
热议问题