1
votes

I am using Jenkins for building my maven project and invoking a standalone sonar analysis which generates the sonar report. But I am not able to generate the unit test coverage report
Note: i have Sonar Runner installed on my Jenkins instance.

Please Help. My sonar properties are:

sonar.projectKey=XXX  
sonar.projectName=YYY  
sonar.sources={Path to Source Code}  
sonar.binaries={Path to Binaries}  
sonar.forceAnalysis=true  
sonar.login={username}  
sonar.password=${Masked_Password}

I have jacoco plugn installed on SONAR. And when i run the sonar analysis,it says

05:47:06.942 INFO  p.PhasesTimeProfiler - Sensor JaCoCoSensor...    
05:47:06.947 INFO  o.s.p.j.JaCoCoPlugin - Project coverage is set to 0% as no JaCoCo execution data has been dumped: /workspace/XXX/target/jacoco.exec 
05:47:07.897 INFO  p.PhasesTimeProfiler - Sensor JaCoCoSensor done: 955 ms 

I have read at places that sonar runner does not runs unit test or shows unit-test coverage report. Is it true? If yes, is there any workaround?

Thanks in advance

1

1 Answers

0
votes

If you're building your project with Maven, why do you try to run a Sonar analysis with the Sonar Runner whereas you can do it as a PostBuild action with Maven? This requires almost no configuration.

See http://docs.codehaus.org/display/SONAR/Triggering+Sonar+on+Jenkins+Job#TriggeringSonaronJenkinsJob-TriggeringaSonarAnalysiswithMaven