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

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

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.

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.

0 votes

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

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Friday in Off-topic

Friday Fun: Dry T-Shirt Competition - What's your BEST (Atlassian) T-Shirt!?

[Note: So it was my turn for Friday Fun and sadly I was sick thanks to rubbish sinus infection... so apologies to most of Europe and Asia for the delayed post. However, I finally got out of bed for t...

141 views 8 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you