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
Published Monday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

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...

304 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