When Clover is enabled compilation fails with a missing type error, for example:
Errors related with a missing symbol might occur when:
- you have source code generation integrated with your build process and
- sources are being generated after Clover's instrumentation
For example, if you have a Maven-based build and you use maven-antrun-plugin or maven-exec-plugin to generate source files:
and you run standard Clover instrumentation, such as:
Clover's code instrumentation (clover:setup) will occur before code generation (as the 'generate-sources' phase will be triggered by the 'test' phase). Clover will also change source roots (e.g. from 'src/main/java' to 'target/clover/src-instrumented'). As a consequence, the BuildTime.java file will be written to an old source root ('src/main/java') and will not be compiled at all.
Please verify if your build process contains any code/resource generation. If it does, make sure that
- Clover is initialized and sources are instrumented after all files are have already been generated
- or ensure that generated sources will be copied to folder(s) containing instrumented files.
You can either do it in a command line:
or you can bind the 'clover:setup' to a build phase which happens after the 'generate-sources' one: