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
- add reference to 1.4.0-RC1 version site
- add information about 'aggregateOnly' parameter, available since version 1.4.0-M5
- add information that 'additionalForkedProjectProperties' parameter is available since version 1.4.0-M5
##### Aggregated reports for multi-module projects
155
156
156
157
There is no separate mojo for aggregated reports, there is `aggregate` parameter.
157
-
To additionally genenerate aggregated SCoverage report for root module, when generating regular reports, set `aggregate` parameter value to `true`.
158
+
To additionally generate aggregated SCoverage report for root module, when generating regular reports,
159
+
set `aggregate` parameter value to `true`.
158
160
It works only in multimodule projects.
159
161
160
162
It can be configured by defining `aggregate` plugin configuration parameter or `scoverage.aggregate` project property.
@@ -205,10 +207,64 @@ or in `reporting/plugins` section when adding report to Maven generated site
205
207
</project>
206
208
```
207
209
210
+
Since version `1.4.0-M5` it's possible to generate aggregated report only, without generating reports for indivisual modules. For large projects it can decrease build time significantly.
211
+
212
+
To generate only aggregated SCoverage report, set `aggregateOnly` parameter value to `true`. It works only in multimodule projects.
213
+
214
+
It can be configured by defining `aggregateOnly` plugin configuration parameter or `scoverage.aggregateOnly` project property.
in `build/plugins` or `build/pluginManagement` section when running reports directly from console (e.g. `mvn scoverage:report`)
225
+
226
+
```xml
227
+
<project>
228
+
<build>
229
+
<plugins>
230
+
<plugin>
231
+
<groupId>org.scoverage</groupId>
232
+
<artifactId>scoverage-maven-plugin</artifactId>
233
+
<version>${scoverage.plugin.version}</version>
234
+
<configuration>
235
+
<aggregateOnly>true</aggregateOnly>
236
+
</configuration>
237
+
</plugin>
238
+
</plugins>
239
+
</build>
240
+
</project>
241
+
```
242
+
243
+
or in `reporting/plugins` section when adding report to Maven generated site
244
+
245
+
```xml
246
+
<project>
247
+
<reporting>
248
+
<plugins>
249
+
<plugin>
250
+
<groupId>org.scoverage</groupId>
251
+
<artifactId>scoverage-maven-plugin</artifactId>
252
+
<version>${scoverage.plugin.version}</version>
253
+
<configuration>
254
+
<aggregateOnly>true</aggregateOnly>
255
+
</configuration>
256
+
</plugin>
257
+
</plugins>
258
+
</reporting>
259
+
</project>
260
+
```
261
+
208
262
##### Adding SCoverage report to site
209
263
210
264
Add plugin to reporting section of your project and configure it to generate one of reporting mojos.
211
-
By default Maven executes all plugin's reporting mojos, but in case of SCoverage plugin this does not make sense, every executed report will overwrite the previous one.
265
+
By default Maven executes all plugin's reporting mojos, but SCoverage plugin has three such mojos
266
+
and it does not make sense, to execute them all because every executed report will overwrite the previous one.
267
+
Configure one of them depending on your case.
212
268
213
269
```xml
214
270
<project>
@@ -348,9 +404,18 @@ Run `mvn scoverage:check` to perform the check and `mvn scoverage:report` to gen
348
404
349
405
##### Checking minimum test coverage level automatically
350
406
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.
407
+
If you want `mvn verify` and `mvn install` to check the coverage level, you have to change your POM
408
+
so that SCoverage takes over running all the tests.
409
+
410
+
The reason for this is that SCoverage instruments classes during compilation and writes them to disk.
411
+
We don't want to accidentally deploy these instrumented classes, so SCoverage keeps them separate.
412
+
SCoverage does this by forking the current Maven build and running it again, while performing instrumentation.
413
+
In a normal setup this causes the tests to be run twice: once in the outer run with the original classes
414
+
and once in the SCoverage-forked run with the instrumented classes.
415
+
416
+
Since version `1.4.0-M5` it's possible to make the tests run only once. You have to configure your pom to turn off testing in the outer run and tell SCoverage to run all tests in the forked run.
352
417
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. SCoverage does this by forking the current Maven build and running it again, while performing instrumentation. In a normal setup this causes the tests to be run twice: once in the outer run with the original classes and once in the SCoverage-forked run with the instrumented classes. To make sure the tests run only once, you have to configure your pom to turn off testing in the outer run and tell SCoverage to run all tests in the fork. This example shows the required configuration:
0 commit comments