Jenkins Clover plugin: coverage report returns 404 or throws NullPointerException

Q: The "Coverage report" link in the Jenkins Clover plugin returns HTTP 404, or the Clover summary shows "null%" and throws a NullPointerException. How do I fix this?

HTTP 404 on the coverage report link

The Jenkins Clover plugin uses two reports, and needs both:

  • the XML report is parsed to get coverage statistics and to show the coverage bar for a build,
  • the HTML report is what you actually browse when drilling down into source files.

If only the XML report is generated, the coverage bar appears but the report link returns 404. Generate the HTML report into the same directory as the XML report.

Note also that Jenkins 1.641 and later apply a Content Security Policy which may block active content in published artifacts, which can affect how the HTML report renders.

NullPointerException / "null% method null, conditional null, statement null"

This indicates the plugin could not locate or parse clover.xml. Ensure the XML report is published where the job configuration expects it. Some versions of the plugin have known defects in locating the file; check for a newer release of the plugin.

See the Jenkins Clover Plugin page.