Thursday, October 18, 2012

Cobertura, Java 7, Alternatives

It has been a while since I have used Cobertura and it has come to my attention that it still doesn't support Java 7. I am told by the good people at Netbeans that JaCoCo is an alternative worth trying and so I will.

Update: To integrate JaCoCo into your maven project you might interested to know that Netbeans integration may not work if you don't add the argLine from JacCoCo agent to your surefire plugin. Your maven build config should look something like this. Note the specification of "jacocoArgLine" property name and the passage of it to surefire via the argLine config property.


    
        
            
                org.apache.maven.plugins
                maven-surefire-plugin
                ${plugin.surefire}
                
                    ${jacocoArgLine} -server -Xms512m -Xmx1024m -XX:+AggressiveOpts -XX:CompileThreshold=200
                    once
                
            
            
                org.jacoco
                jacoco-maven-plugin
                0.6.0.201210061924
                
                    
                        
                            prepare-agent
                        
                    
                    
                        report
                        prepare-package
                        
                            report
                        
                    
                
                
                    11508
                    jacocoArgLine
                    ${project.build.sourceEncoding}
                    ${project.build.sourceEncoding}
                    ${project.build.directory}/jacoco.exec
                    ${project.build.directory}/jacoco
                    ${project.build.directory}/jacocoClassDump
                
            
        
    

+1 Netbeans

No comments: