Q: My build prints "No Clover instrumentation done on source files" and/or "No Clover database found, skipping report generation". Why?
These messages - together with Clover registry file <path/to/clover.db> does not exist - are different symptoms of the same root cause: Clover did not instrument any source file, so no Clover database was created and there is nothing to report on.
See Clover registry file does not
exist in the Knowledge Base for the full list of causes and resolutions (invalid initstring
location, database missing on a remote machine, no clean before
clover-setup). Two causes are worth calling out here:
An invalid <include> path in Maven
This is the most common cause in Maven builds. Clover silently matches no files if the include
pattern points to a directory which does not exist. A frequent mistake is using a Maven property
which does not exist, for example ${project.source.directory}. Use the correct
properties:
<configuration>
<includes>
<include>${project.build.sourceDirectory}</include>
<include>${project.build.testSourceDirectory}</include>
</includes>
</configuration>
or specify the paths explicitly:
<configuration>
<includes>
<include>src/main/java</include>
<include>src/test/java</include>
</includes>
</configuration>
An unsupported JDK
Instrumentation may fail if you run OpenClover on a JDK newer than it supports. See Which Java and Groovy versions are supported? - note that the frequently quoted "JDK 17 is not supported" applies to OpenClover 4.4.1 and not to current releases.