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 Join to answer
Community showcase
Teodora [Botron]
Published Feb 15, 2018 in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

1,183 views 6 19
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot