Generating clover report on top level folder in a multi-module project

I have a multi-module maven project and I am aggregating the cloverdb from all the sub-projects.Is it possible to execute clover2:clover just on the top level folder and not on all the sub-projects?

1 answer

0 vote

Hello @Vinayak Hegde,

Unfortunately there's not option for that. I've just created JIRA issue for that, you can track and vote for it here:

https://jira.atlassian.com/browse/CLOV-1749

 

But I found out some workaround, which includes profile usages. Please change your modules configuration in parent pom.xml such as:

<profiles>
    <profile>
        <id>reportOnly</id>
		<!-- for this profile we don't want to have any modules -->
    </profile>
    <profile>
        <id>default</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <modules>
            <module>jar1</module>
            <module>jar2</module>
            <module>war1</module>
            <module>ear1</module>
<!-- all modules here-->
        </modules>
    </profile>

 

With such configuration please perform report generation in two commands:

mvn clover2:setup test clover2:aggregate

which will instrument code, generate coverage and aggregate results to the root project, and afterwards:

mvn clover2:clover -P reportOnly

which will generate reports only for root project, because within this profile there aren't any submodules.

 

Please, let me know if it works for you. 

 

Cheers,

Grzegorz

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 13 hours ago in Hipchat

Moving from Hipchat to Stride? Here’s what you’ll love

Heya, Hipchat friends! We’re so happy you’re checking out   Stride. Whether you know it or not, you have been instrumental in making Stride come to life. Every feature, design, and functionality...

40 views 0 4
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