Generating clover reports from builds fail if the license location is not specified in the builder configuration
症状
After adding the Clover license to Bamboo and adding the Clover plugin to the builder (e.g., you have added it to your pom in the case of a Maven builder), the build fails with the following warning in atlassian-bamboo.log
:
2013-04-23 22:01:54,534 WARN [7-BAM::Default Agent::Agent:pool-16-thread-1] [ExecuteBuildTask] Failed to execute plugin with class com.atlassian.bamboo.builder.coverage.CloverBuildProcessor : TESTA-TSTA-JOB1-11
java.lang.Exception: No file matches the specified pattern:**/clover.xml in [D:\atlassian\BAMBOO\atlassian-bamboo-4.4.5\HOME\xml-data\build-dir\TESTA-TSTA-JOB1]
at com.atlassian.bamboo.builder.coverage.CloverBuildProcessor.call(CloverBuildProcessor.java:141)
at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.performCustomBuildProcess(ExecuteBuildTask.java:164)
at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:90)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:206)
at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:111)
at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52)
at java.lang.Thread.run(Thread.java:722)
The build log shows the following error:
[ERROR] Failed to execute goal
com.atlassian.maven.plugins:maven-clover2-plugin:3.1.10:setup
(default-cli) on project webapplication: Execution default-cli of goal
com.atlassian.maven.plugins:maven-clover2-plugin:3.1.10:setup failed:
Your license has expired..Please visit http://www.atlassian.com to
obtain a license. -> [Help 1]
原因
This is caused by the fact that the license location needed to be specified in the pom file as described in Troubleshooting License problems. The license added to Bamboo is to be able to parse already prepared Clover reports.
ソリューション
Rather than installing the Clover plugin as:
<build>
<plugins>
...
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<version>${clover.version}</version>
</plugin>
...
</plugins>
</build>
Please try something like this:
<build>
<plugins>
...
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<version>${clover.version}</version>
<licenseLocation>/path/to/clover.license</licenseLocation>
</plugin>
...
</plugins>
</build>
注意:
In case where the build will be run from a Remote Agent, then it will not be feasible to specify a unified license location in the POM. In such case, please try the following options:
- Append the license string in the
pom.xml
in aCDATA
tag. In this case, there is no need to put a reference as suggested in Troubleshooting License problems. Add the license in the repository which will be checked out to the working directory and use something like this in the POM:
<licenseLocation>./clover.license</licenseLocation>