Clover Knowledge Base : Can't measure coverage using merged database


Several Clover databases created during instrumentation are merged into one. Next such merged database is used to run instrumented application. During application startup a following message appears:

ERROR: CLOVER: Unable to load coverage database.
ERROR: CLOVER: No coverage data will be gathered.
ERROR: CLOVER: com.cenqua.clover.registry.ReadOnlyRegistryException
ERROR: CLOVER: This database can only be used for reporting because it 
is the result of a merge. It does not support further coverage 



It is possible to merge several Clover databases into one in order to have a single coverage report. However, such merged database becomes 'read-only' and cannot be used for further code coverage gathering.



Use original non-merged databases for execution of application module(s).


Alternatively, it's possible to create a single database for several application modules during instrumentation and use just one database at runtime:

  • in Maven use the <singleCloverDatabase> parameter
  • in Ant setup Clover in master build file and make sure that inheritrefs="true" is used across ant calls.