<commit_before>scoverage-maven-plugin
===================

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

[![Build Status](https://travis-ci.org/scoverage/scoverage-maven-plugin.png)](https://travis-ci.org/scoverage/scoverage-maven-plugin)


## How to use

In short:

- **check** goal compiles classes with instrumentation, runs tests and checks coverage,

- **report** goal compiles classes with instrumentation, runs tests and generates html report as part of project's site,

- **report-only** goal generates html report as part of project's site using coverage data generated earlier in the build (in most cases by **check** goal),

- **pre-compile** and **post-compile** are internal goals, don't use them,

- **check-only** goal only check coverage, honestly I don't know if it will be usable at all. 

Check [all plugin goals (mojos) documentation](http://scoverage.github.io/scoverage-maven-plugin/1.0.0/plugin-info.html).


##### Prerequisities / limitations

Plugin is compatible with two Maven Scala compiler plugins:

- [SBT Compiler Maven Plugin](https://code.google.com/p/sbt-compiler-maven-plugin/) - version **1.0.0-beta5** or later required,

- [Scala Maven Plugin](http://davidb.github.io/scala-maven-plugin/) - [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.


##### Scoverage Maven plugin version

This can be set as project property.

```xml
<project>
    <properties>
        <scoverage.plugin.version>1.0.0</scoverage.plugin.version>
    </properties>
</project>
```


##### Scala version configuration

Plugin supports Scala 2.10.x and 2.11.x versions by automatically loading and configuring scalac-scoverage-plugin_2.10 or scalac-scoverage-plugin_2.11 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. 

```xml
<project>
    <properties>
        <scala.version>2.11.4</scala.version>
    </properties>
</project>
```

or

```xml
<project>
    <build>
        <plugins>
            <plugin>
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
                <version>${scoverage.plugin.version}</version>
                <configuration>
                    <scalaVersion>2.11.4</scalaVersion>
                    <-- other parameters -->
                </configuration>
             </plugin>
        </plugins>
    </build>
</project>
```

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. 

```xml
<project>
    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>
    </dependencies>
</project>
```


##### [Scalac SCoverage plugin](https://github.com/scoverage/scalac-scoverage-plugin) version configuration

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.
If newer, better version of [scalac-scoverage-plugin](https://github.com/scoverage/scalac-scoverage-plugin) is available, it can be used instead.
It can be configured by defining "scalacPluginVersion" plugin configuration parameter or "scoverage.scalacPluginVersion" project property.

```xml<commit_msg>... reverted.<commit_after>scoverage-maven-plugin
===================

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

[![Build Status](https://travis-ci.org/scoverage/scoverage-maven-plugin.png)](https://travis-ci.org/scoverage/scoverage-maven-plugin)


## How to use

In short:

- **check** goal compiles classes with instrumentation, runs tests and checks coverage,

- **report** goal compiles classes with instrumentation, runs tests and generates html report as part of project's site,

- **report-only** goal generates html report as part of project's site using coverage data generated earlier in the build (in most cases by **check** goal),

- **pre-compile** and **post-compile** are internal goals, don't use them,

- **check-only** goal only check coverage, honestly I don't know if it will be usable at all. 

Check [all plugin goals (mojos) documentation](http://scoverage.github.io/scoverage-maven-plugin/1.0.0/plugin-info.html).


##### Prerequisities / limitations

Plugin is compatible with two Maven Scala compiler plugins:

- [SBT Compiler Maven Plugin](https://code.google.com/p/sbt-compiler-maven-plugin/) - version **1.0.0-beta5** or later required,

- [Scala Maven Plugin](http://davidb.github.io/scala-maven-plugin/) - [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.


##### Scoverage Maven plugin version

This can be set as project property.

```xml
<project>
    <properties>
        <scoverage.plugin.version>1.0.0</scoverage.plugin.version>
    </properties>
</project>
```


##### Scala version configuration

Plugin supports Scala 2.10.x and 2.11.x versions by automatically loading and configuring scalac-scoverage-plugin_2.10 or scalac-scoverage-plugin_2.11 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. 

```xml
<project>
    <properties>
        <scala.version>2.11.4</scala.version>
    </properties>
</project>
```

or

```xml
<project>
    <build>
        <plugins>
            <plugin>
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
                <version>${scoverage.plugin.version}</version>
                <configuration>
                    <scalaVersion>2.11.4</scalaVersion>
                    <-- other parameters -->
                </configuration>
             </plugin>
        </plugins>
    </build>
</project>
```

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. 

```xml
<project>
    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>
    </dependencies>
</project>
```


##### Scalac SCoverage plugin version configuration

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.
If newer, better version of [scalac-scoverage-plugin](https://github.com/scoverage/scalac-scoverage-plugin) is available, it can be used instead.
It can be configured by defining "scalacPluginVersion" plugin configuration parameter or "scoverage.scalacPluginVersion" project property.

```xml
{'fraction_non_alphanumeric': 0.12124273806516797, 'fraction_numerical': 0.007577671129072998, 'mean_word_length': 3.6664702416028283, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 89, 'https://': 13, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3031945', 'n_tokens_mistral': 2378, 'n_tokens_neox': 2203, 'n_words': 676}