<commit_before>[allure-junit-pom-example]: https://github.com/allure-framework/allure-core/blob/master/docs/allure-junit-pom-example.md
[steps-and-attachments]: https://github.com/allure-framework/allure-core/blob/master/docs/steps-and-attachments.md

## Allure JUnit integration module

To use **Allure** with **JUnit**, just add following code to your **pom.xml**:

``` xml
<!--Allure version, needed here for allure-maven-plugin. It can be moved to parent pom.-->
<properties>
    <allure.version>1.2.2</allure.version>
</properties>

<!--This dependency is necessary for Allure JUnit plugin. It can be moved to parent pom.-->
<dependencies>
    <dependency>
        <groupId>ru.yandex.qatools.allure</groupId>
        <artifactId>allure-junit-adaptor</artifactId>
        <version>${allure.version}</version>
    </dependency>
</dependencies>

<!--Allure JUnit plugin. It can be moved to parent pom. -->
<build>
    <plugins>
        <plugin>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-junit-plugin</artifactId>
            <version>${allure.version}</version>
            <executions>
                <execution>
                    <phase>test-compile</phase>
                    <goals>
                        <goal>allure</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<!--Allure Maven Plugin. It can be moved to parent pom-->
<reporting><commit_msg>Added readme<commit_after>[allure-junit-pom-example]: https://github.com/allure-framework/allure-core/blob/master/docs/allure-junit-pom-example.md
[steps-and-attachments]: https://github.com/allure-framework/allure-core/blob/master/docs/steps-and-attachments.md

## Allure JUnit integration module

The first way (recommended), **RUNTIME**, *without using aspectj compiler and bytecode injections*,
(don't work with AQUA framework for now) to use allure with **JUnit** and **Maven**:

First of all add allure version property and dependency of **allure-junit-adaptor**:

```xml
<properties>
    <allure.version>1.2.2</allure.version>
</properties>

<dependency>
    <groupId>ru.yandex.qatools.allure</groupId>
    <artifactId>allure-junit-adaptor</artifactId>
    <version>${allure.version}</version>
</dependency>
```

then, add **maven surefire plugin** with next configuration:

```xml
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.16</version>
    <configuration>
        <argLine>
            -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
        </argLine>
        <properties>
            <property>
                <name>listener</name>
                <value>ru.yandex.qatools.allure.junit.AllureRunListener</value>
            </property>
        </properties>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>${aspectj.version}</version>
        </dependency>
    </dependencies>
</plugin>
```

In the end u need to add **allure-report-plugin** to reporting section:

```xml
<reporting>
    <excludeDefaults>true</excludeDefaults>
    <plugins>
        <plugin>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-maven-plugin</artifactId>
            <version>${allure.version}</version>
        </plugin>
    </plugins>
</reporting>
```

Another way (not recommended), **COMPILE**, with using aspectj compiler and bytecode injections:

``` xml
<properties>
    <allure.version>1.2.2</allure.version>
</properties>

<dependencies>
    <dependency>
        <groupId>ru.yandex.qatools.allure</groupId>
        <artifactId>allure-junit-adaptor</artifactId>
        <version>${allure.version}</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-junit-plugin</artifactId>
            <version>${allure.version}</version>
            <executions>
                <execution>
                    <phase>test-compile</phase>
                    <goals>
                        <goal>allure</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<reporting>
{'fraction_non_alphanumeric': 0.14612281488121917, 'fraction_numerical': 0.002689376961004034, 'mean_word_length': 2.5933977455716586, 'pattern_counts': {'":': 0, '<': 137, '<?xml version=': 0, '>': 137, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '6849423', 'n_tokens_mistral': 1440, 'n_tokens_neox': 1324, 'n_words': 246}