Skip to content

Commit d038af4

Browse files
committedApr 29, 2019
Update README.md file
- 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
1 parent 988349f commit d038af4

File tree

1 file changed

+69
-4
lines changed

1 file changed

+69
-4
lines changed
 

‎README.md

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Maven generated plugin documentation:
4444
| Version | Documentation |
4545
|------------------|--------------------------------------------------------------------------------------------------|
4646
| `1.3.0` | [Plugin Info](http://scoverage.github.io/scoverage-maven-plugin/1.3.0/plugin-info.html) |
47+
| `1.4.0-RC1` | [Plugin Info](http://scoverage.github.io/scoverage-maven-plugin/1.4.0-RC1/plugin-info.html) |
4748

4849
##### Prerequisities / limitations
4950

@@ -154,7 +155,8 @@ or
154155
##### Aggregated reports for multi-module projects
155156

156157
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`.
158160
It works only in multimodule projects.
159161

160162
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
205207
</project>
206208
```
207209

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.
215+
216+
```xml
217+
<project>
218+
<properties>
219+
<scoverage.aggregateOnly>true</scoverage.aggregateOnly>
220+
</properties>
221+
</project>
222+
```
223+
224+
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+
208262
##### Adding SCoverage report to site
209263

210264
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.
212268

213269
```xml
214270
<project>
@@ -348,9 +404,18 @@ Run `mvn scoverage:check` to perform the check and `mvn scoverage:report` to gen
348404

349405
##### Checking minimum test coverage level automatically
350406

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.
352417

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:
418+
This example shows the required configuration:
354419

355420
```xml
356421
<project>

0 commit comments

Comments
 (0)