How to have clover2 coverage and deploy non-instrumented jars

Hi,

I'm not able to have code coverage and deploy un-instrumented jars on same maven build

By what says here:

https://confluence.atlassian.com/display/CLOVERKB/Maven+is+deploying+instrumented+jars

I should able to achieve that by using clover2:intstrument and / or clover2:instrument-test but it does not provides much more details.

If I execute something like this:

mvn -e -U -Pcoverage clean compile clover2:instrument-test test clover2:clover package

maven only produces instarumented jars in a specific location but no un-instrumented jars are produced (so packaging fails)

How can I have instrumented classes for clover to provide coverage but package un-instrumented classes in the default location ?

 

1 answer

0 vote
  1. instrument-test goal forks the lifecycle and runs only to test phase because of which it's not present during package phase, in order to generate jar with cloverized source code you shall use instrument goal
  2. In general when you call compile goal before instrument may cause calling this phase multiple times which is not necessary, because instrument forks the build lifecycle.

If that won't help, here's couple of additional questions to help determining what's going wrong in your env:

  1. What did you specified in the coverage profile ? Could you pass a snippet here ? 
  2. You're saying that packaging fails, with what error ?  Instrument mojo forks a lifecycle so it should not affect your normal build. 
  3. Is Clover reporting any errors ?

 

Note:

If you want to use newest Clover (currently 4.1.1) you have to redefine all references to clover-maven-plugin and call Clover goals by clover name, e.g clover:instrument, more info accessible here

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published Apr 19, 2018 in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

366 views 0 6
Read article

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