It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

OpenClover Check Goal calculates different coverage into Maven multi-module project than Log Edited

Hi all!

 

I'm facing some issues about how to check the coverage threshold with openclover maven plugin with a multi-module Maven Project.

I execute the tests with:

mvn clover:setup test clover:aggregate clover:clover

 

Then, i execute the Log goal with

mvn clover:log

 

After that, i'm trying to check the coverage with:

mvn clover:check -Dmaven.clover.targetPercentage=XX%

 

The build fails because clover calculates a different value, from parent project, compared to the HTML Report or Log goal

 

Here is the output:

INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openclover:clover-maven-plugin:4.3.1:check (default-cli) on project example-parent: Build failed to meet Clover coverage targets: The following coverage targets for null were not met:
[ERROR] Total coverage of 53.5% did not meet target of 100%
[ERROR] -> [Help 1]

 

What am I doing wrong? 

Does Clover check goal require additional steps to work?

 

Thanks

1 answer

0 votes

As you use 'clover:aggregate' it suggests that you have multiple modules in your project, am I correct? Maybe what happens is that clover:check is ran on a different clover.db file.

I suggest the following:

  • find all clover.db files generated in your project, including cloverMerge.db
  • run clover:check on all of them (passing cloverMergeDatabase or cloverDatabase options) 
  • check if any of these produce valid results

Note that clover:check searches for both cloverDatabase and cloverMergeDatabase

Note that clover:aggregate runs in the last Maven module being built and writes cloverMerge.db to that location. Which means that probably you may want to add cloverMergeDatabase parameter in your root pom to specify the location.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Trello

Are Atlassian tools a good fit for your marketing team? Find out.

When I got appointed as the Marketing Specialist at TechTime in October 2019, I was introduced to the world of Atlassian. Working in tech, I knew about the tools - but never been exposed to it. At f...

223 views 6 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you