"intermediate directory contains no translation units" error while Coverity Static Analysis of my Java project

user3604158 picture user3604158 · May 12, 2016 · Viewed 7.8k times · Source

Recieved following warning while capturing the build for my project on Coverity. [WARNING] No files were emitted. This may be due to a problem with your configuration or because no files were actually compiled by your build command. Please make sure you have configured the compilers actually used in the compilation.

Answer

Caleb picture Caleb · May 20, 2016

cov-build needs to know about what compilers you have in your build system. This is informed by the generated configs (using cov-configure).

For a Java project, usually cov-configure --java is sufficient. This will have cov-build look for javac invocations.

Another common problem is that you didn't do a clean build, so no actual compilations were seen.

If you've configured Java properly and captured a clean build and still aren't seeing TUs emitted, then you'll need to inspect the build log (underneath <intermediate directory>/build-log.txt). This should give some indication of what's gone wrong.