Not able to generate clover reports for integration tests using maven build. Edited

Hi,

I am running both Unit Tests and Integration Test and attached clover-plugin to both the profiles in my pom. If I run the mvn build for only unit tests, the clover report is getting generated fine. But if I run the mvn build for only Integration tests, then the clover report is not getting generated. Instead, it is throwing the following error in the logs.

[INFO] org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/myfolder/app/target/jetty/webapps/app/WEB-INF/classes/com/myconfig.class]; nested exception is java.lang.NoClassDefFoundError: com_atlassian_clover/TestNameSniffer
[INFO] at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:303)

--------------------

[INFO] org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/myfolder/app/target/jetty/webapps/app/WEB-INF/classes/com/myconfig.class]; nested exception is java.lang.NoClassDefFoundError: com_atlassian_clover/TestNameSniffer
[INFO] at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:303)

 --------------------

Even if I run mvn build to include both Unit and Integration tests together, it is throwing the above error and this time it is not even generating the report for Unit Tests as well. Any help is really appreciated. Note that I also have jacoco plugin for both these profiles in my pom and generating the jacoco report as well parallelly.

1 answer

This widget could not be displayed.

Clover is required in the classpath when code coverage is being gathered.


I don't know how do you run your integration tests but generally speaking, please make sure clover.jar is available in the container. 

 

But note, you probably don't want this dependency in production so make sure it's there only when required (code coverage)

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

78 views 1 0
Join discussion

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