Clover Knowledge Base : Failed to execute plugin 'Clover Results Collector'

Symptoms

Bamboo with Clover is used. Clover tab is not visible for a Job. Clover statistics are not available in build Metadata after the build. Build log contains an error message like this:

Running post build plugin 'Clover Results Collector'
Failed to execute plugin 'Clover Results Collector' with error: No file matches the specified pattern:target/site/clover\**\clover.xml in [<bamboo_home>\xml-data\build-dir\AA-BB-JOB1]

Cause

1) Build has failed causing that not all Clover's goals have been called

  • the "Automatically integrate Clover into this build" is used
  • automatic Clover integration adds extra goals to the Maven command line, such as "clover:setup verify clover:aggregate clover:clover"
  • build fails in the test phase due to test failures
  • Maven breaks the build, as a consequence latter goals (clover:aggregate clover:clover) are not called, Clover reports are not generated
  • as report is unavailable, the "Failed to execute Clover Results Collector" error appears at the end of the build

or


2) Clover's XML report was written do a directory different than defined in Job configuration (manual integration)

  • manual Clover integration is configured
  • path to XML report is declared (Job configuration > Miscellaneous tab > Clover XML Location field)
  • a build succeeds and a build log shows that Clover's XML report has been generated
  • but path from a build log does not match the path configured (for instance: build was performed in a subdirectory or there is a typo in the path)
  • as a consequence, the "Failed to execute Clover Results Collector" error appears

or

3) Clover Results Collector tries to find an XML file in a wrong subdirectory (automatic integration)

  • automatic Clover integration is enabled
  • Job contains several tasks, one or more tasks has the "working subdirectory" field filled
  • build succeeds, the XML report is being written to one subdirectory, but the Clover Results Collector searches for it in another subdirectory
  • as a consequence, the "Failed to execute Clover Results Collector" error appears

 

 

 

Resolution

ad 1) Do not fail a build in case of test failures

  • set the maven.test.failure.ignore=true property for Surefire plugin or
  • set the setTestFailureIgnore=true property for Clover plugin (which sets several common properties)

 

ad 2) Ensure that XML location is correct

  • either correct "Clover XML Location" field
  • or define custom location for Clover reports in Maven Task - see the clover:setup goal

 

ad 3) Ensure that first non-VCS checkout task has the working directory same the one where XML report is being written to

When the automatic integration is enabled, the Bamboo Clover Plugin takes a first task which is not a VCS checkout one from a list of tasks declared in a Job. A working subdirectory declared in this task is assumed to be a root folder in which the Clover Results Collector searches for the clover.xml file. Next, to this working subdirectory the plugin appends one of the following patterns, depending on the task type:

  • /clover/**/clover.xml - for Ant tasks
  • /target/clover/report/**/clover.xml - for Grails tasks
  • /target/site/clover/**/clover.xml - for Maven tasks

For this reason, if one of your tasks generates a Clover report, please ensure that the first task (after the "VCS checkout" ones) has the same working directory as the task generating the report. You can, for example:

  • change working subdirectory used in tasks, 
  • change order of tasks,
  • add an empty task after the "VCS Checkout" one with a proper working subdirectory.