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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

121 views 2 0
Join discussion

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