javamavenmaven-surefire-pluginclover

Surefire and OpenClover - Generate Clover report if tests fail


I am using the plugin maven-surefire-plugin version 2.20.1 and version 4.2.0 of the OpenClover plugin

Surefire Setup

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.20.1</version>
        </plugin>

OpenClover Setup

<plugin>
    <groupId>org.openclover</groupId>
    <artifactId>clover-maven-plugin</artifactId>
    <version>4.2.0</version>
</plugin>

If any tests fail - the clover report is not generated Here is the command I use to generate my tests

mvn  clean clover:setup test clover:aggregate clover:clover -DskipTests=false -DtestFailureIgnore=true

Any ideas on what I need to do in order to get clover to generate a report even with test failures?

Thank you Damien


Solution

  • I resolved this by adding the maven --fail-never option to my maven command

    The updated command is

    mvn  clean clover:setup test clover:aggregate clover:clover -DskipTests=false -DtestFailureIgnore=true -fail-never