What is the proper way to use Cobertura with Maven 3.0.2

前端 未结 3 1906
醉话见心
醉话见心 2020-12-30 00:51

I have been trying unsuccessfully for the last few days to run Cobertura 2.4 with Maven 3.0.2. We have a very large project with many modules (sub-projects). What I found is

3条回答
  •  借酒劲吻你
    2020-12-30 01:17

    I successfully integrated Cobertura in my projects with adding this:

      
        
          
            org.codehaus.mojo
            cobertura-maven-plugin
            2.4
            
              
                
                  foo/bar/**/*.class
                
              
            
        
          
            clean
            pre-site
            
              clean
            
          
          
            instrument
            site
            
              instrument
              cobertura
            
          
        
          
        
      
    
      
        
          
        
        org.codehaus.mojo
        cobertura-maven-plugin
        2.4
        
          
            html
            xml
          
         
          
        
      
    

    If you run mvn cobertura:cobertura the reports will be generated in target\site\cobertura. See also maven cobertura plugin.


    Today I analyze projects with SonarQube. It has an easy installation step (if you are not interested in using an enterprise database) and also includes a code coverage analysis (using JaCoCo) among many other metrics.

提交回复
热议问题