0
votes

I am trying to find out code coverage on new lines only. I use jacoco report for IT coverage and run mvn sonar:sonar. Sonar does not display the new line code coverage. I am not sure what configuration I am missing.It seems to work for svn repo. I run mvn sonar on the base version and again with the latest version. I am using Perforce,SonarQube 4.4, SCM Activity Plugin 1.8. Here is my POM.xml,

<scm>
<connection>scm:perforce:username@perforceserver:portnumber://depot</connection>
<developerConnection>scm:perforce:username@perforceserver:portnumber://depot</developerConnection>
<url>scm:perforce:username@perforceserver:portnumber://depot</url>
</scm>
<properties>
<skipTests>false</skipTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.jacoco.itReportPath>C:/SonarData/ExecFiles/CSMmergeddata.exec</sonar.jacoco.itReportPath>
<sonar.scm.reloadBlame>true</sonar.scm.reloadBlame>
<sonar.language>java</sonar.language>
</properties> 
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${acme-corporate-pom.sonarVersion}</version>
</plugin>

...

1
Does the tool produce a log file when it runs? Have you looked in that file? - Bryan Pendleton
I checked the log and found following : SCM provider not found I am finding coverage between specified version and latest version.But always latest version considered for analysis , thus i guess no new line coverage found - Sunil

1 Answers

1
votes

To have code coverage on new line information, SonarQube relies on information from the SCM engine. As you can see on the SCM Activity plugin matrix, Subversion is perfectly supported but not Perforce - which is only known to be tested by some users but not formally validated by SonarQube team as "supported".

So either:

  • your configuration of the SCM Activity plugin is not correct

  • or you hit a bug in the implementation of the Maven SCM library (we know there are some bugs)