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

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
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 Stride

Get Started in Stride in 3 Easy Steps

Get started on Stride in 3 easy steps   If you’re new to Stride, welcome! We’re super excited to have you aboard. Stride is easy to use and set up, so don’t worry about reading tons of borin...

48 views 0 2
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