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\Windows\Temp\CCD-CAA-JOB1
  -f  build.xml
  clover.fullclean clean
  -Dclover.skip.json=true  -Dclover.optimization.enabled=false
  -lib  "D:\Soft\Bamboo\Bamboo-4.3\webapp\WEB-INF\lib\clover-3.1.5.jar" 

for Maven:

command	... Beginning to execute external process for build ... running command line: D:\Soft\Maven\apache-maven-2.2.1\bin\mvn.bat\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


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 -Dclover.license.path=/opt/path/to/clover.license


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 4 hours ago in United States

Atlassian acquires AgileCraft

         Good Day, Bad bad traffic, not sure why!!!! 1/2 hour commute took me 2 hours today 🤯 What helped me is that I kept browsing LinkedIn until...

24 views 1 0
View post

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