Allure Results Directory Path Setup | Allure Java

Profile picture for user devraj

When you execute your tests, the allure results folder is generated in the project root directory. If you want to change the default output path of allure results folders, you can do it in different ways.

Table of Content

  1. Specify Path in Properties File
  2. Add Properties in Surefire Plugin
  3. Video Tutorial

1. Specify Path in Properties File

One way is to specify the path of the allure results folder in the allure properties file. Follow the below steps:

Step 1: Create the allure.properties file in the src/test/resources folder

Step 2: Add key allure.results.directory in the property file with the path as a value.

allure.results.directory=target/allure-results

Now, output will be generated in allure-results folder inside target.

Step 3: Execute your test using the below command

mvn clean test

2. Add Properties in Surefire Plugin

Another way is you can specify properties in the surefire plugin in the system properties section. Add Following Property.

<systemProperties>
    <property>
        <name>allure.results.directory</name>
        <value>target/allure-results</value>
    </property>
</systemProperties>

Sample Plugin Code

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>3.0.0-M7</version>
    <configuration>
        <parallel>methods</parallel>
        <threadCount>3</threadCount>
        <perCoreThreadCount>false</perCoreThreadCount> 
        <systemProperties>
            <property>
                <name>allure.results.directory</name>
                <value>target/allure-results</value>
            </property>
         </systemProperties>
    </configuration>
</plugin>

Video Tutorial: Allure Results Directory Path Setup