Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

merging clover db files with maven

alex z December 27, 2012

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

0 votes
jjaroczynski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 27, 2012

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
TAGS
AUG Leaders

Atlassian Community Events