• Community
  • Questions
  • [clover-html-report] No coverage recordings found. No report will be generated.

[clover-html-report] No coverage recordings found. No report will be generated.

I am using clover with ant to generate coverage reports to an existing java project that already has unit test cases.

My ant target first runs clover-setup then builds the code using javac and then runs the tests using junit. I have added clover.jar to the runtime classpath for the test cases.

When i run the build target i see clover logs saying that classes have been instrumented

[clover] Clover all over. Instrumented 28 files (3 packages).

However when i run the <clover-html-report> task no report is generated. Instead the log shows

[clover-html-report] No coverage recordings found. No report will be generated.

If code coverage is being collected/logged what log messages am i expected to see when junit is executing?

1 answer

1 accepted

0 vote

1) Please check in which order your targets are being called. A common mistake is to call <javac> first, followed by <clover-setup>. As a consequence, sources are instrumented, but not compiled. Assuming that you're using Clover-for-Ant, a typical sequence is:

  • clean (to ensure all sources will be recompiled)
  • instrument sources (<clover-setup> or <clover-instr>)
  • compile (<javac>)
  • test (<junit> or other)
  • reporting (<clover-report> or <clover-html-report>

2) Please double check if the clover.jar is on the classpath. In case it's missing you may find "NoClassDefFoundError" exceptions in the junit log.

3) Please check if clover.db is accessible by your application during test execution. It may happen that instrumented classes cannot find the database, especially when unit tests are ran from a working directory different than the build directory or on another machine.

In such case you shall find warning messages in the junit log about it.

How to fix it? You can:

* use an absolute path in <clover-setup initstring="..."> or

* run unit tests from the same working directory as build or

* copy clover.db to a proper location/machine and pass -Dclover.initstring=/path/to/clover.db JVM property

4) Please check what flush policy do you have in <clover-setup> set. You may change the default setting in case you're running your code on an application server.

The problem was that clover.jar was not on the classpath.

I had used a <classpath refid=""> in my junit task but that did not seem to work. If use the


	&lt;pathelement location=""/&gt;


mechanism, then it works fine.

Thank you for your help

Suggest an answer

Log in or Join to answer
Community showcase
Alexey Matveev
Published Saturday in Jira

How to run Jira in a docker container

Everything below is tested on Ubuntu 17.10. I prefer to use Jira in a docker container because: 1. I can install Jira with a couple of commands. 2. I can start and stop Jira just by starting and s...

50 views 1 3
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