I am using Cobertura with Maven.
I would like the assembly to fail if the coverage is below a given threshold, but I would like the site (including the Cobertura report) to still be generated. This is because developers will need to check the coverage report to find out where they can add more features to fix a failed build.
Currently my pom looks like this:
<project> <build> ... <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>${cobertura.version}</version> <configuration> <check> <totalLineRate>${cobertura.check.totalLineRate}</totalLineRate> </check> </configuration> <executions> <execution> <goals> <goal>clean</goal> <goal>check</goal> </goals> </execution> </executions> </plugin> ... </plugins> </build> <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>${cobertura.version}</version> </plugin> ... </plugins> </reporting> </project>
If I run mvn clean verify site , then it generates an HTML coverage report if the coverage target is met, but it does not build without generating a report if the coverage target is not fulfilled. How can I change it to always generate a report?
source share