How to upload Clover Code coverage report to SonarQube dashboard?

I'm facing the issue while uploading clover code coverage report to SonarQube dashboard.

In the project target folder i'm able to see the clover generated report, but not sure what parameters needs to passed for the clover report to be pushed to SonarQube Dashboard?

The documentation mentioned in the wiki : https://docs.sonarqube.org/display/SONARQUBE45/Clover+Plugin  says to set a property "sonar.clover.reportPath"  following the wiki, this is how i've configured my pom. But still its not uploading the clover report to sonarQube dasboard.

This is how my pom.xml file is configured.

<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<packaging>pom</packaging>
	
	<properties>
		<!-- MAVEN CONFIGURATIONS -->
		<java.version>1.8</java.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.clover2.plugin.version>4.0.6</maven.clover2.plugin.version>
		<sonar.clover.reportPath>${project.basedir}/target/site/clover/clover.xml</sonar.clover.reportPath>
	</properties>
	
	<build>
		<plugin>
			<groupId>com.atlassian.maven.plugins</groupId>
			<artifactId>maven-clover2-plugin</artifactId>
			<version>${maven.clover2.plugin.version}</version>
			<configuration>
				<generateHtml>true</generateHtml>
				<generateXml>true</generateXml>
				<includesTestSourceRoots>false</includesTestSourceRoots>
				<includesAllSourceRoots>true</includesAllSourceRoots>
				<excludes>
					<exclude>**/*Exception*.java</exclude>
				</excludes>
				<license>***</license>
			</configuration>
		</plugin>
	</build>
</project>

Command that i'm executing : mvn -X clean install clover2:instrument clover2:aggregate clover2:clover sonar:sonar

 

 

1 answer

0 vote

Hi Manjunath!

I'm facing the issue while uploading clover code coverage report to SonarQube dashboard.

Could you give more details, please? Do you see any error messages?

 

Command that i'm executing : mvn -X clean install clover2:instrument clover2:aggregate clover2:clover sonar:sonar

Did you try using the clover2:setup? It will not fork the parallel build cycle, as the clover2:instrument does, so hopefully it will better cooperate with the Sonar plugin. Please try the following:

 

mvn clean clover2:setup install clover2:aggregate clover2:clover sonar:sonar

 

Cheers
Marek

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

94 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you