<commit_before>[![Build Status](https://travis-ci.org/timgifford/maven-buildtime-extension.svg?branch=master)](https://travis-ci.org/timgifford/maven-buildtime-extension)
# Overview
Maven doesn't give you detailed information about where you build is taking the most time. This build time extension
displays the duration for each goal that is ran during your build.

# Usage
Put this in your pom.xml to find out why you are slow.
By default this will log only to maven debug `-X,--debug`, however debug is quite noisy so you can enable output to normal log
via the property `buildtime.output.log` in your pom or via commandline `-Dbuildtime.output.log=true`.

## Capture the results to a CSV file
Thanks to [@leonard84](https://github.com/leonard84) for the contribution. You'll need to set a property to enable this feature. 
Eventually, we can enhance this functionality to include other output formats. 
I personally would like to publish the results to an InfluxDb instance.

```
mvn compile -Dbuildtime.output.csv=true -Dbuildtime.output.csv.file=classes\out.csv
```

Maven introduced slf4j in version 3.2 which broke this build extension for Maven 3.0 users. 
Version 2.0+ will work with the latest version of Maven.

## Maven 3.3 - Use version 3.0+

With version 3.0.0 we switched to Mavens `EventSpy` API which increases the compatibility with other tools, e.g. Jenkins which
also use this API to instrument Maven. However this requires a different way of loading the extension. This also requires at
least Maven 3.3+. 

Create the following file `<projectroot>/.mvn/extenstions.xml` with this as content

```
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
    <extension>
        <groupId>co.leantechniques</groupId>
        <artifactId>maven-buildtime-extension</artifactId>
        <version>3.0.0</version>
    </extension>
</extensions>
```
Due to [MNG-5786](https://issues.apache.org/jira/browse/MNG-5786) you might need to use Maven 3.3.9 if 
`<projectroot>/.mvn/extenstions.xml` is not picked up. You can also check the build log for the presence of the string
`BuildTimeEventSpy is registered.` which is loggged if the extension was successfully activated.

## Maven 3.2 - Use version 2.0+ ```Deprecated```


```
<build>
    <extensions>
        <extension>
            <groupId>co.leantechniques</groupId>
            <artifactId>maven-buildtime-extension</artifactId>
            <version>2.0.3</version>
        </extension>
    </extensions>
</build>
```

## Maven 3.0 - Use version 1.0 ```Deprecated```<commit_msg>Fix some typos in README.md<commit_after>[![Build Status](https://travis-ci.org/timgifford/maven-buildtime-extension.svg?branch=master)](https://travis-ci.org/timgifford/maven-buildtime-extension)
# Overview
Maven doesn't give you detailed information about where your build is taking the most time. This build time extension
displays the duration for each goal that is run during your build.

# Usage
Put this in your pom.xml to find out why you are slow.
By default this will log only to maven debug `-X,--debug`, however debug is quite noisy, so you can enable output to normal log
via the property `buildtime.output.log` in your pom or via commandline `-Dbuildtime.output.log=true`.

## Capture the results to a CSV file
Thanks to [@leonard84](https://github.com/leonard84) for the contribution. You'll need to set a property to enable this feature. 
Eventually, we can enhance this functionality to include other output formats. 
I personally would like to publish the results to an InfluxDb instance.

```
mvn compile -Dbuildtime.output.csv=true -Dbuildtime.output.csv.file=classes\out.csv
```

Maven introduced slf4j in version 3.2 which broke this build extension for Maven 3.0 users. 
Version 2.0+ will work with the latest version of Maven.

## Maven 3.3 - Use version 3.0+

With version 3.0.0 we switched to Maven's `EventSpy` API which increases the compatibility with other tools, e.g. Jenkins which
also use this API to instrument Maven. However this requires a different way of loading the extension. This also requires at
least Maven 3.3+. 

Create the following file `<projectroot>/.mvn/extensions.xml` with this as content

```
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
    <extension>
        <groupId>co.leantechniques</groupId>
        <artifactId>maven-buildtime-extension</artifactId>
        <version>3.0.0</version>
    </extension>
</extensions>
```
Due to [MNG-5786](https://issues.apache.org/jira/browse/MNG-5786) you might need to use Maven 3.3.9 if 
`<projectroot>/.mvn/extensions.xml` is not picked up. You can also check the build log for the presence of the string
`BuildTimeEventSpy is registered.` which is logged if the extension was successfully activated.

## Maven 3.2 - Use version 2.0+ ```Deprecated```


```
<build>
    <extensions>
        <extension>
            <groupId>co.leantechniques</groupId>
            <artifactId>maven-buildtime-extension</artifactId>
            <version>2.0.3</version>
        </extension>
    </extensions>
</build>
```

## Maven 3.0 - Use version 1.0 ```Deprecated```
{'fraction_non_alphanumeric': 0.10502552021986651, 'fraction_numerical': 0.01884570082449941, 'mean_word_length': 3.8523809523809525, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 2, '>': 53, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '3966564', 'n_tokens_mistral': 1610, 'n_tokens_neox': 1486, 'n_words': 573}