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 Join to answer
Community showcase
Emilee Spencer
Published Friday in Marketplace Apps

Marketplace Spotlight: DeepAffects

Hello Atlassian Community! My name is Emilee, and I’m a Product Marketing Manager for the Marketplace team. Starting with this post, I'm kicking off a monthly series of Spotlights to highlight Ma...

58 views 0 3
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot