i have war and need to clover the build to my integration tests with maven


I'm new to clover and have war from dev team and need to perform build with clover and run my integration tests with maven.

  1. Could you help how to build the war with clover.
  2. How to run mvn integration tests on clover build

3 answers

1 accepted

0 votes
Answer accepted

Hi vinod kumar,

You can't really run Clover with already builded war file. It's because Clover is basing on source code instrumentation. But you can integrate Clover with Maven to build proper artifact and generate code coverage reports from it.

Here are some links from documentation how to achieve it:

Remember about setting up flush policy, which may cause some problems:


If you have problems with configuring Clover feel free to ask,

Best Regards,

Grzegorz Lewandowski


Thanks Grze,I'm able to move further on Clover.Hava a quick Question

  1. What is difference between mvn clean clover2:setup  and mvn clover2:instrument and when to use it
  2. Do i need to copy the colver jars tomcat server in lib folder or clover war is enough to place in webapps
  3. when i perform clover setup on my productservice dev code.In target folder, following folders are created
    2) Clover
    3) productservice.war
    4) productservice folders
    5) And in clover folder i see productservice-clover.war and productservice-clover
    Should i take productservice.war  or productservice-clover.war to place in tomcat/webapps?

0 votes


  1. The main difference is that clover2:setup saves time stamp for Clover test optimization feature and clover2:instrument forks the process and add suffixes for generated artifacts, in general if you won't be use any specific automatic deployment we're suggesting using clover2:setup 
  2. clover.jar is required by instrumented code otherwise you'll face ClassNotFoundErrors so your need ensure clover.jar is in the classpath by i.e:

    1. bundling it in created war in META-INF/lib directory
    2. providing it in $CATALINA_BASE/lib directory, for reference
  3. productservice-clover.war was generated because you've used clover2:instrument and in that case productservice.war won't contain instrumented sources, so in general it depends on which goal are you using:
    1. for clover2:setup you should use productservice.war
    2. for clover2:instrument you should use productservice-cloverr.war



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Opsgenie

Getting the Most out of Atlassian and Opsgenie Together

We’re excited to invite you to this action-packed webinar where we will demonstrate how to integrate Opsgenie’s powerful alerting and on-call management tools with your entire Atlassian stack. Mar...

66 views 0 1
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