Failed to execute plugin 'Clover Results Collector'

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

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]

原因

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

または


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

または

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




ソリューション

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)

設定方法

You need to set the setTestFailureIgnore=true property for Clover plugin (which sets several common properties). You can set this under the Goal section of the maven tasks.

More about this flag setTestFailureIgnore:

If set to true, Clover will add several properties to the build configuration which disable a build failure for following plugins:--


 *  maven-surefire-plugin (maven.test.failure.ignore=true)
 *  maven-failsafe-plugin (maven.test.failure.ignore=true)
 *  maven-checkstyle-plugin (checkstyle.failOnViolation=false)
 *  maven-pmd-plugin (pmd.failOnViolation=false)


 Thanks to this, build continues despite test failures or code validation failures and thus it is possible to generate a Clover coverage report for failed tests at the end of the build.

Note: before version 3.1.9 the testFailureIgnore property was set to true for the forked Clover lifecycle ('instrument' goal) for 'test' and 'integration-test' phases. Since 3.1.9 it is no longer set.


Type: boolean
Since: 3.1.9
Required: No
User Property: maven.clover.setTestFailureIgnore

Default: false*


-Dmaven.clover.setTestFailureIgnore=true



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.




Please Note

In some cases, even if the Clover plugin is disabled in Bamboo server, remote agent tries to ignore the disabled state and the plugin gets transferred over to the remote agent during start-up.

So initially in Bamboo server, the Clover plugin was enabled and was used in a task. Then for some reason, it was disabled, then the clover task might have been removed afterwards from Job. The agent still tries to download the plugin. The remote agent did not have the chance to get the latest state from the Bamboo server to download the disabled version of the clover plugin. To fix this you can reenable the plugin.
You can try to enable the plugin on the Bamboo server side, remove the task that is using this plugin first and then disable the plugin again.

最終更新日 2022 年 9 月 29 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.