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
Copy file name to clipboardExpand all lines: README.md
+37-34Lines changed: 37 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,12 @@ scoverage-maven-plugin
3
3
4
4
scoverage-maven-plugin is a plugin for Maven that integrates the scoverage code coverage library. Find out more about [scoverage](https://github.com/scoverage/scalac-scoverage-plugin).
5
5
6
-
[](https://gitter.im/scoverage/scoverage-maven-plugin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-**[pre-compile](http://scoverage.github.io/scoverage-maven-plugin/2.0.1/pre-compile-mojo.html)** and **[post-compile](http://scoverage.github.io/scoverage-maven-plugin/2.0.1/post-compile-mojo.html)** are internal goals, they configure Maven build in forked `scoverage` life cycle; don't use them.
Plugin is compatible with two Maven Scala compiler plugins:
48
+
- The plugin is compatible with two Maven Scala compiler plugins:
51
49
52
-
-[SBT Compiler Maven Plugin](https://github.com/sbt-compiler-maven-plugin/sbt-compiler-maven-plugin/) - version **1.0.0-beta5** or later required,
50
+
-[Scala Maven Plugin](http://davidb.github.io/scala-maven-plugin/) - version `3.0.0` or later required, [addScalacArgs](http://davidb.github.io/scala-maven-plugin/compile-mojo.html#addScalacArgs) and [analysisCacheFile](http://davidb.github.io/scala-maven-plugin/compile-mojo.html#analysisCacheFile) configuration parameters cannot be set directly, use project properties `addScalacArgs` and `analysisCacheFile` instead.
51
+
52
+
-[SBT Compiler Maven Plugin](https://github.com/sbt-compiler-maven-plugin/sbt-compiler-maven-plugin/) - version `1.0.0-beta5` or later required. Currently it works only with Scoverage Maven Plugin `1.4.11` or earlier.
53
53
54
-
-[Scala Maven Plugin](http://davidb.github.io/scala-maven-plugin/) - version **3.0.0** or later required, [addScalacArgs](http://davidb.github.io/scala-maven-plugin/compile-mojo.html#addScalacArgs) and [analysisCacheFile](http://davidb.github.io/scala-maven-plugin/compile-mojo.html#analysisCacheFile) configuration parameters cannot be set directly, use project properties 'addScalacArgs' and 'analysisCacheFile' instead.
54
+
- Starting with version `2.0.0` the plugin supports Scala `2.12.8+`, `2.13.0+` and `3.2.0+`. For Scala `2.10` and `2.11` support please use version `1.4.11`.
55
+
- The plugin is not thread-safe, so it should not be used in multi-threaded builds.
55
56
56
57
57
-
#####Scoverage Maven plugin version
58
+
### Scoverage Maven plugin version
58
59
59
60
This can be set as project property.
60
61
@@ -67,9 +68,12 @@ This can be set as project property.
67
68
```
68
69
69
70
70
-
#####Scala version configuration
71
+
### Scala version configuration
71
72
72
-
Plugin supports Scala 2.12.8+, 2.13.0+ and 3.2.0+ versions by automatically loading and configuring matching `scalac-scoverage-plugin` Scalac SCoverage Plugin artifact. For this to work Scala version has to be set. It can be done by defining `scalaVersion` plugin configuration parameter or `scala.version` project property. Without this setting, coverage will not be calculated.
73
+
The plugin automatically loads and configures matching `scalac-scoverage-plugin` artifact when needed.
74
+
For this to work the Scala version has to be set. It can be done by defining the `scalaVersion` plugin configuration parameter or the `scala.version` project property.
75
+
Without this setting, the plugin will try to resolve the Scala version from the `scala-library` dependency of the project.
76
+
If all the attempts to resolve the Scala version fail, then coverage will not be calculated.
73
77
74
78
```xml
75
79
<project>
@@ -99,7 +103,8 @@ or
99
103
</project>
100
104
```
101
105
102
-
The first method is better because once the property is defined it's value can be used in other places of the build file. For example in `scala-library` dependency version every Scala build should declare.
106
+
The first method is better because once the property is defined its value can be used in other places of the build file.
107
+
For example in the `scala-library` dependency version every Scala build should declare.
103
108
104
109
```xml
105
110
<project>
@@ -113,13 +118,11 @@ The first method is better because once the property is defined it's value can b
113
118
</project>
114
119
```
115
120
116
-
For Scala 2.10 and 2.11 support please use Scoverage Maven plugin `1.4.11`.
117
-
118
-
##### Scalac SCoverage plugin version configuration
121
+
### Scalac SCoverage plugin version configuration
119
122
120
123
Maven SCoverage plugin uses by default the latest version of the [scalac-scoverage-plugin](https://github.com/scoverage/scalac-scoverage-plugin) available on its release day.
121
124
If newer, better version of [scalac-scoverage-plugin](https://github.com/scoverage/scalac-scoverage-plugin) is available, it can be used instead.
122
-
It can be configured by defining `scalacPluginVersion` plugin configuration parameter or `scoverage.scalacPluginVersion` project property.
125
+
It can be configured by defining the `scalacPluginVersion` plugin configuration parameter or the`scoverage.scalacPluginVersion` project property.
123
126
124
127
```xml
125
128
<project>
@@ -149,19 +152,19 @@ or
149
152
</project>
150
153
```
151
154
152
-
#####Integration tests coverage check and reports
155
+
### Integration tests coverage check and reports
153
156
154
157
`integration-check` and `integration-report` mojos are similar to `check` and `report` mojos, but they execute forked `scoverage` life cycle up to `verify` phase (integration tests are usually executed in `integration-test` phase).
155
158
156
-
#####Aggregated reports for multi-module projects
159
+
### Aggregated reports for multi-module projects
157
160
158
161
There is no separate mojo for aggregated reports, there is `aggregate` parameter.
159
162
To additionally generate aggregated SCoverage report for root module, when generating regular reports,
160
163
set `aggregate` parameter value to `true`.
161
164
It works only in multimodule projects, the aggregated report will be generated in the current
162
165
execution root.
163
166
164
-
It can be configured by defining `aggregate` plugin configuration parameter or `scoverage.aggregate` project property.
167
+
It can be configured by defining the `aggregate` plugin configuration parameter or the`scoverage.aggregate` project property.
165
168
166
169
```xml
167
170
<project>
@@ -213,7 +216,7 @@ Since version `1.4.0-M5` it's possible to generate aggregated report only, witho
213
216
214
217
To generate only aggregated SCoverage report, set `aggregateOnly` parameter value to `true`. It works only in multimodule projects.
215
218
216
-
It can be configured by defining `aggregateOnly` plugin configuration parameter or `scoverage.aggregateOnly` project property.
219
+
It can be configured by defining the `aggregateOnly` plugin configuration parameter or the`scoverage.aggregateOnly` project property.
217
220
218
221
```xml
219
222
<project>
@@ -261,11 +264,11 @@ or in `reporting/plugins` section when adding report to Maven generated site
261
264
</project>
262
265
```
263
266
264
-
#####Adding SCoverage report to site
267
+
### Adding SCoverage report to site
265
268
266
-
Add plugin to reporting section of your project and configure it to generate one of reporting mojos.
267
-
By default Maven executes all plugin's reporting mojos, but SCoverage plugin has three such mojos
268
-
and it does not make sense, to execute them all because every executed report will overwrite the previous one.
269
+
Add the plugin to reporting section of your project and configure it to generate one of reporting mojos.
270
+
By default, Maven executes all plugin's reporting mojos, but the SCoverage plugin has three such mojos,
271
+
and it does not make sense to execute them all because every executed report will overwrite the previous one.
269
272
Configure one of them depending on your case.
270
273
271
274
```xml
@@ -299,7 +302,7 @@ Which reporting mojo should be selected:
299
302
|[integration-report](http://scoverage.github.io/scoverage-maven-plugin/2.0.1/integration-report-mojo.html)| When using integration tests |
300
303
|[report-only](http://scoverage.github.io/scoverage-maven-plugin/2.0.1/report-only-mojo.html)| When coverage data was already generated (usually by [check](http://scoverage.github.io/scoverage-maven-plugin/2.0.1/check-mojo.html) or [integration-check](http://scoverage.github.io/scoverage-maven-plugin/2.0.1/integration-check-mojo.html) mojo) |
301
304
302
-
#####Customizing code instrumentation
305
+
### Customizing code instrumentation
303
306
304
307
If you want to customize plugin's configuration parameters used by compilation supporting part of the plugin, do it in 'plugins' or 'pluginManagement' section:
305
308
```xml
@@ -325,7 +328,7 @@ If you want to customize plugin's configuration parameters used by compilation s
325
328
Read [SBT SCoverage Plugin documentation](https://github.com/scoverage/sbt-scoverage) for more information about [highlighting](https://github.com/scoverage/sbt-scoverage#highlighting) and [excludedPackages](https://github.com/scoverage/sbt-scoverage#exclude-classes-and-packages).
326
329
327
330
328
-
#####Checking minimum test coverage level
331
+
### Checking minimum test coverage level
329
332
330
333
```xml
331
334
<project>
@@ -362,7 +365,7 @@ Run `mvn scoverage:check` to perform the check. See below if you want to use `mv
362
365
Read [SBT SCoverage Plugin documentation](https://github.com/scoverage/sbt-scoverage#minimum-coverage) for more information.
363
366
364
367
365
-
#####Checking minimum test coverage level AND adding report to site
368
+
### Checking minimum test coverage level AND adding report to site
0 commit comments