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

前端 未结 7 2032
傲寒
傲寒 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条回答
  •  有刺的猬
    2020-11-28 21:37

    you can configure the coverage exclusion in the sonar properties, outside of the configuration of the jacoco plugin:

    ...
    
        ....
        
            **/generated/**/*,
            **/model/**/*
        
        
            src/test/**/*
        
        ....
        jacoco
        ${project.basedir}/../target/jacoco.exec
        
            **/generated/**/*,
            **/model/**/*
        
        0.7.5.201505241946
        ....
    
    ....
    

    and remember to remove the exclusion settings from the plugin

提交回复
热议问题