Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can Bamboo run clover tests via ant without checking a volatile license file into source?

Charles Albrecht January 9, 2013

The engineer who is developing clover coverage ant tasks for our source tells me that even though we have put a clover license file into Bamboo, the individual jobs are incapable of using the information in that file and an additional copy of that file needs to be checked into source for every project and every codeline where we will want to use clover.

This can't be the case, can it? Is it possible for the ant tasks running under bamboo to access the license file that bamboo already knows about so it can be centrally managed in exactly one place?

3 answers

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 10, 2013

Hi Charles,

In case when you have manual Clover integration, then the best way is to store Clover license file on Bamboo server (and on EC2 images if you use remote agents) in a well defined directory, as suggested by Eddie.

Next just point to this license file in Ant task configuration:

  • go to the "Job configuration > Tasks > Ant task"
  • add -Dclover.license.path to the "Target" field, e.g.
    clean with.clover test clover.report -Dclover.license.path=/opt/path/to/clover.license

Cheers
Marek

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 10, 2013

Hi Charles,

There is no need to commit Clover license file into project sources. Instead of this:

1) Paste Clover license key on the Bamboo administration page (Administration > Plugins > Clover Plugin > Global License Key)

2) Use automatic Clover integration for a build job (go to "Job configuration > Miscellaneous", enable "Use Clover to collect Code Coverage for this build", select "Automatically integrate Clover into this build")

Bamboo will automatically copy global license key into temporary file and provide it for a build as -Dclover.license.path (for Ant) or -Dmaven.clover.licenseLocation (for Maven). It works both for Ant and Maven.

You can find a message in build log like (I broke a log line and removed obsolete parts for clarity):

for Ant:

command	... Beginning to execute external process for build ... running command line: d:\Soft\Ant\apache-ant-1.8.3\bin\ant.bat
  -Djava.io.tmpdir=C:\Windows\Temp\CCD-CAA-JOB1
  -f  build.xml
  clover.fullclean clean test.run
  -Dclover.skip.json=true  -Dclover.skip.report=true  -Dclover.optimization.enabled=false
  -lib  "D:\Soft\Bamboo\Bamboo-4.3\webapp\WEB-INF\lib\clover-3.1.5.jar" 
  ...
  -Dclover.license.path="D:\Data\bamboo-home\xml-data\build-dir\CCD-CAA-JOB1\.clover\clover.license"
  ...

for Maven:

command	... Beginning to execute external process for build ... running command line: D:\Soft\Maven\apache-maven-2.2.1\bin\mvn.bat
  -Djava.io.tmpdir=C:\Windows\Temp\CCD-CMA-JOB1
  clean  test  clean  com.atlassian.maven.plugins::maven-clover2-plugin:setup  verify  
  com.atlassian.maven.plugins::maven-clover2-plugin:aggregate  com.atlassian.maven.plugins::maven-clover2-plugin:clover
  -Dmaven.clover.generateJson=false
  -Dmaven.clover.licenseLocation=D:\Data\bamboo-home\xml-data\build-dir\CCD-CMA-JOB1\.clover\clover.license
  ... 

Cheers
Marek

0 votes
EddieW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 10, 2013

That doesn't sound right.

Although the clover license configured bamboo may only support Maven tasks (with the auto clover option checked) it is still a simple matter to use a single license file to support all tasks.

We have a clover license file on the same server as bamboo, in a well known directory. Any ant task can leverage this file. The path can also be set as a global variable to make it easier for users to implement.

Charles Albrecht January 10, 2013

But still, this is something that needs to be tracked externally from bamboo itself, right? (Either a per-agent file externally maintained in the environment with a capability pointing to the location, or the equivalent.)

If the bamboo clover integration doesn't automatically push the license into the build directory, I suppose I'll recommend a non-branched license file checked into source with an independent source check-out task to place it in the right spot in the build directory.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events