It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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 votes

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
Community showcase
Posted in Jira

Watch Slack + Atlassian's Webinar: “Transform cross-functional collaboration with Slack + Atlassian

Hi Atlassian Community! We recently partnered together with Slack on a webinar, “ Transform cross-functional collaboration with Slack + Atlassian ”. Building fast, growing exponentially: all...

71 views 0 5
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you