This is coming from a previous thread that is read-only now unfortunately so here is the history:
Jul 31, 2008
I have a multi-module project with maven clover2 plugin and clover 2.3.2. Module B pom.xml has dependency on a test-jar in Module A. I verified that the Module A has a target / clover/ test-classes dir generated with the required class in Module B.
When compiling with maven 2.0.7 (mvn clean install clover2:instrument clover2:clover) it tells me that the tests are failing in Module B.
CLOVER FATAL ERROR: Clover could not be initialised. Are you sure you have Clover in the runtime classpath? (class java.lang.NoClassDefFoundError:com_cenqua_clover/CloverVersionInfo)
When I look at surefire test reports - it shows me an error as below: testCardSaleTransaction(com.kryterion.ecom.PaymentManagerTest)
Now I can definitely get around it by adding clover as a dependency to Module B, but that would wrap that jar file in the final web app war which we don't really want.
Can someone point me to the root cause of the problem and a correct fix for this?
Supposed work around which is NOT working
Aug 8, 2010
This problem is due to the fact that Maven2 doesn't handle artifacts with two classifiers correctly. In your case, -clover and -tests .
The work around for this is to use the clover2:setup goal instead of clover2:instrument when running your build with clover on.
We now write Jan 2012 and I am running into the same issue which is very frustrating ...
I am using clover2:setup but my build agents get horked by the clover run just like described above.
Would appreciate a statement if this issue is just not important enough to fix or what exactly is being done about this.
Please note that the fastest way to get a response and a working solution is to raise an issue at http://support.atlassian.com. I suppose that the most optimal will be to use clover2:setup with a Clover configured in a profile running in a separate build (to make sure that no instrumented classes will 'leak' into the production binaries) and a separate maven local cache for installing 'cloverized' binaries. I'm eager to help you, but without full build logs, information about project structure, pom.xml files etc it's really hard to do this.
Should have came back to this question, once I did get past it, sorry. BUt I think Marek's answer is right on.
In our case we were using Jetty in our mavenized projects to run IT tests on the bamboo agent and simply adding clover as a dependency to the Jetty plugin did the trick. This keeps it out of the production war/ear, but lets the instrumented code run through testing.
Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...
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!
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