Automatic Clover integration in Bamboo does not always work as expected for Maven

"Automatically integrate Clover into this build" switch in Bamboo is great, however it does not always work for Maven-based projects. There are few areas in which you can get stuck:

  1. deploying instrumented application to web server might result in NoClassDefFoundError during test execution
  2. simple unit tests can fail with NoClassDefFoundError if project has multiple Maven modules with inter-dependencies
  3. generation of historical report might fail with an error message like "basedir /home/bamboo/xml-data/build-dir/MY-JOB1/my-module/.cloverhistory is not a directory"

1 answer

1 accepted

This widget could not be displayed.

ad 1. This can happen when instrumented application is being executed in another JVM. For example, when you deploy code under test to the application server or run in-container tests using maven-cargo-plugin. Instrumented code needs clover.jar in classpath at runtime.

See NoClassDefFound com_cenqua_clover/CoverageRecorder KB article.

 

ad 2. This can happen when one module has a dependency to another one and your Maven task in Bamboo runs tests. For example if Maven task has "clean test" goals defined and the "ModuleA" depends on "ModuleB", then build with Clover will look like:

ModuleB clean
ModuleB test   # run tests without Clover
ModuleB clean
ModuleB clover2:setup
ModuleB verify # run tests with Clover
ModuleB jar    # package classes; instrumented classes are taken!
ModuleA clean
ModuleA test   # run tests without Clover, instrumented ModuleB.jar is taken; 
# test fails with NoClassDefFound error
...
ModuleB clean
ModuleB clover2:setup
ModuleB verify  # run tests with Clover

 

See NoClassDefFound com_cenqua_clover/CoverageRecorder KB article and https://jira.atlassian.com/browse/BAM-13208 improvement request for more details. This has been fixed in Clover 4.0.4 and Bamboo 5.9.

 

ad 3. See Multi-module Maven build on Bamboo with Clover history reports KB article. This has been fixed in Clover 3.1.12 and Bamboo 5.0.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

106 views 2 0
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