merging clover db files with maven

Hello, i would like to produce a merged database containing the measured coverage of all databases found under for example /home/clover/

I found the way with ant :

<clover-merge initString="mergedcoverage.db">
    <cloverDbSet dir="/home/projects" span="30 mins">
          <include name="**/coverage.db"/>
    </cloverDbSet>
 </clover-merge>

How i can do it with maven?

1 answer

Hi,

That's possible for multi-module maven project. There are two options:

  • Define single database so submodules do not have separate databases:
    • define <singleCloverDatabase>true</singleCloverDatabase> in top-level pom.xml; sub-modules will inherit this setting
    • define <cloverDatabase>/path/to/network/drive/clover.db</cloverDatabase> in top-level pom.xml;
    • do not define <cloverDatabase> attribute in sub-modules, because it would override the singleCloverDatabase parameter

      <plugin>
      <groupId>com.atlassian.maven.plugins</groupId>
      <artifactId>maven-clover2-plugin</artifactId>
      <configuration>
      <cloverDatabase>/path/to/network/drive/clover.db</cloverDatabase>
      <singleCloverDatabase>true</singleCloverDatabase>
      </configuration>
      </plugin>
  • Use separate databases for submodules and merge them before creating report:
    • Don't define <cloverDatabase> and <singleCloverDatabase> in top-level pom.xml so that default values will be used (relative path target/clover/clover.db and false).

    • Merge databases: "mvn clover2:aggregate"

      <!-- Top-level pom.xml -->
      <plugin>
      <groupId>com.atlassian.maven.plugins</groupId>
      <artifactId>maven-clover2-plugin</artifactId>
      <configuration>
      <cloverMergeDatabase>/path/to/network/drive/cloverMerged.db</cloverMergeDatabase>
      </configuration>
      </plugin>

Read more here: https://confluence.atlassian.com/display/CLOVER/Using+Clover+in+various+environment+configurations#UsingCloverinvariousenvironmentconfigurations-Scenario2-multi-moduleapplicationexecutedonseveralserversindependently

Cheers,
Jacek

Suggest an answer

Log in or Sign up to answer
Community showcase
Asked Thursday in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

5,414 views 21 17
View question

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