Skip to content

Commit 6657d62

Browse files
committed
Update README
1 parent 5083983 commit 6657d62

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

README.md

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ scoverage-maven-plugin
33

44
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).
55

6-
[![Join the chat at https://gitter.im/scoverage/scoverage-maven-plugin](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/scoverage/scoverage-maven-plugin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
7-
86
[![Build Status](https://github.com/scoverage/scoverage-maven-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/scoverage/scoverage-maven-plugin/actions/workflows/ci.yml)
9-
[![License](http://img.shields.io/:license-Apache%202-red.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)
107
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.scoverage/scoverage-maven-plugin/badge.svg)](http://search.maven.org/#search|ga|1|g%3A%22org.scoverage%22%20AND%20a%3A%22scoverage-maven-plugin%22)
8+
[![License](http://img.shields.io/:license-Apache%202-red.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)
9+
[![Gitter](https://img.shields.io/gitter/room/scoverage/scoverage.svg)](https://gitter.im/scoverage/scoverage-maven-plugin)
1110

12-
13-
## How to use
11+
### How to use
1412

1513
mostly used mojos:
1614

@@ -38,23 +36,26 @@ internal mojos:
3836

3937
- **[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.
4038

41-
Maven generated plugin documentation:
39+
### Maven generated plugin documentation
4240

43-
| Version | Documentation |
44-
|---------------|-----------------------------------------------------------------------------------------------|
45-
| `2.0.1` | [Plugin Info](http://scoverage.github.io/scoverage-maven-plugin/2.0.1/plugin-info.html) |
46-
| `1.4.11` | [Plugin Info](http://scoverage.github.io/scoverage-maven-plugin/1.4.11/plugin-info.html) |
41+
| Version | Documentation |
42+
|----------|------------------------------------------------------------------------------------------|
43+
| `2.0.1` | [Plugin Info](http://scoverage.github.io/scoverage-maven-plugin/2.0.1/plugin-info.html) |
44+
| `1.4.11` | [Plugin Info](http://scoverage.github.io/scoverage-maven-plugin/1.4.11/plugin-info.html) |
4745

48-
##### Prerequisites / limitations
46+
### Prerequisites / limitations
4947

50-
Plugin is compatible with two Maven Scala compiler plugins:
48+
- Plugin is compatible with two Maven Scala compiler plugins:
5149

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

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` 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+
- Plugin is not thread-safe, so it should not be used in multi-threaded builds.
5556

5657

57-
##### Scoverage Maven plugin version
58+
### Scoverage Maven plugin version
5859

5960
This can be set as project property.
6061

@@ -67,9 +68,12 @@ This can be set as project property.
6768
```
6869

6970

70-
##### Scala version configuration
71+
### Scala version configuration
7172

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+
Plugin automatically loads and configures matching `scalac-scoverage-plugin` artifact when needed.
74+
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.
75+
Without this setting, plugin will try to resolve Scala version from `scala-library` dependency of the project.
76+
If all the attempts to resolve Scala version fail, then coverage will not be calculated.
7377

7478
```xml
7579
<project>
@@ -99,7 +103,7 @@ or
99103
</project>
100104
```
101105

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. For example in `scala-library` dependency version every Scala build should declare.
103107

104108
```xml
105109
<project>
@@ -113,9 +117,7 @@ The first method is better because once the property is defined it's value can b
113117
</project>
114118
```
115119

116-
For Scala 2.10 and 2.11 support please use Scoverage Maven plugin `1.4.11`.
117-
118-
##### Scalac SCoverage plugin version configuration
120+
### Scalac SCoverage plugin version configuration
119121

120122
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.
121123
If newer, better version of [scalac-scoverage-plugin](https://github.com/scoverage/scalac-scoverage-plugin) is available, it can be used instead.
@@ -149,11 +151,11 @@ or
149151
</project>
150152
```
151153

152-
##### Integration tests coverage check and reports
154+
### Integration tests coverage check and reports
153155

154156
`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).
155157

156-
##### Aggregated reports for multi-module projects
158+
### Aggregated reports for multi-module projects
157159

158160
There is no separate mojo for aggregated reports, there is `aggregate` parameter.
159161
To additionally generate aggregated SCoverage report for root module, when generating regular reports,
@@ -261,11 +263,11 @@ or in `reporting/plugins` section when adding report to Maven generated site
261263
</project>
262264
```
263265

264-
##### Adding SCoverage report to site
266+
### Adding SCoverage report to site
265267

266268
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+
By default, Maven executes all plugin's reporting mojos, but SCoverage plugin has three such mojos,
270+
and it does not make sense to execute them all because every executed report will overwrite the previous one.
269271
Configure one of them depending on your case.
270272

271273
```xml
@@ -299,7 +301,7 @@ Which reporting mojo should be selected:
299301
| [integration-report](http://scoverage.github.io/scoverage-maven-plugin/2.0.1/integration-report-mojo.html) | When using integration tests |
300302
| [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) |
301303

302-
##### Customizing code instrumentation
304+
### Customizing code instrumentation
303305

304306
If you want to customize plugin's configuration parameters used by compilation supporting part of the plugin, do it in 'plugins' or 'pluginManagement' section:
305307
```xml
@@ -325,7 +327,7 @@ If you want to customize plugin's configuration parameters used by compilation s
325327
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).
326328

327329

328-
##### Checking minimum test coverage level
330+
### Checking minimum test coverage level
329331

330332
```xml
331333
<project>
@@ -362,7 +364,7 @@ Run `mvn scoverage:check` to perform the check. See below if you want to use `mv
362364
Read [SBT SCoverage Plugin documentation](https://github.com/scoverage/sbt-scoverage#minimum-coverage) for more information.
363365

364366

365-
##### Checking minimum test coverage level AND adding report to site
367+
### Checking minimum test coverage level AND adding report to site
366368

367369
```xml
368370
<project>
@@ -409,7 +411,7 @@ Read [SBT SCoverage Plugin documentation](https://github.com/scoverage/sbt-scove
409411
Run `mvn scoverage:check` to perform the check and `mvn scoverage:report` to generate the report.
410412

411413

412-
##### Checking minimum test coverage level automatically
414+
### Checking minimum test coverage level automatically
413415

414416
If you want `mvn verify` and `mvn install` to check the coverage level, you have to change your POM
415417
so that SCoverage takes over running all the tests.

0 commit comments

Comments
 (0)