You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run `mvn scoverage:check` to perform the check and `mvn scoverage:report` to generate the report.
347
+
348
+
349
+
##### Checking minimum test coverage level automatically
350
+
351
+
If you want `mvn verify` and `mvn install` to check the coverage level, you have change your POM so that SCoverage takes over running all the tests.
352
+
353
+
The reason for this is that SCoverage instruments classes during compilation and writes them to disk. We don't want to accidentally deploy these instrumented classes, so SCoverage keeps them separate. This causes the tests to be run twice: once with the original classes and once through SCoverage with the instrumented ones. To make sure the tests run only once, you have to configure your pom like this:
<phase>prepare-package</phase> <!-- or any other phase -->
382
+
</execution>
383
+
</executions>
384
+
</plugin>
385
+
</plugins>
386
+
</build>
387
+
</project>
388
+
```
389
+
390
+
Run `mvn clean verify` or `mvn clean install` to run the tests with coverage and all other static analysis you have configured.
391
+
392
+
If you want to set multiple properties from within `<additionalForkedProjectProperties>`, for instance because you want to disable other plugins from running twice, you can separate them with a semicolon:
0 commit comments