Skip to main content
The framework is configured through three files: pom.xml (dependencies and build settings), allure.properties (report output directory), and TestRunner.java (Cucumber runtime options). This page documents every configurable point.

pom.xml

Key properties

<properties>
    <maven.compiler.source>21</maven.compiler.source>
    <maven.compiler.target>21</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <allure.version>2.27.0</allure.version>
    <aspectj.version>1.9.21</aspectj.version>
</properties>
PropertyValueDescription
maven.compiler.source / target21Java 21 is required. Do not lower this — AspectJ 1.9.21 targets Java 21.
allure.version2.27.0Shared version for all io.qameta.allure artifacts.
aspectj.version1.9.21AspectJ weaver version. Must be compatible with the Java version.

Dependencies

ArtifactVersionScopePurpose
selenium-java4.18.1compileSelenium 4 WebDriver and built-in driver manager
testng7.9.0testTest runner (required by AbstractTestNGCucumberTests)
allure-testng2.27.0testAllure integration for TestNG
cucumber-java7.15.0testCucumber core and step definition annotations
cucumber-testng7.15.0testBridges Cucumber scenarios into TestNG test methods
allure-cucumber7-jvm2.27.0testAllure plugin that captures Cucumber step results
cucumber-picocontainer7.15.0testPicoContainer dependency injection for Cucumber

Maven Surefire plugin

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>3.2.5</version>
    <configuration>
        <argLine>
            -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
        </argLine>
        <systemPropertyVariables>
            <allure.results.directory>
                ${project.build.directory}/allure-results
            </allure.results.directory>
        </systemPropertyVariables>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>${aspectj.version}</version>
        </dependency>
    </dependencies>
</plugin>
argLine — AspectJ javaagent The -javaagent argument loads aspectjweaver at JVM startup. This is required for Allure to intercept @Step, @Attachment, and similar annotations via compile-time/load-time weaving. Without it, Allure will still generate a report but step-level data will be missing. systemPropertyVariables Sets allure.results.directory as a JVM system property at test runtime, pointing Allure to target/allure-results. This takes precedence over allure.properties when both are present.
The ${settings.localRepository} placeholder resolves to your local Maven repository (typically ~/.m2/repository). The aspectjweaver JAR must be present there before tests run — it is downloaded automatically on the first mvn test invocation.

Allure Maven plugin

<plugin>
    <groupId>io.qameta.allure</groupId>
    <artifactId>allure-maven</artifactId>
    <version>2.12.0</version>
</plugin>
Provides two additional Maven goals:
GoalCommandDescription
allure:reportmvn allure:reportGenerates the HTML report from target/allure-results
allure:servemvn allure:serveGenerates and opens the report in a browser via a local HTTP server

allure.properties

Located at src/test/resources/allure.properties.
allure.results.directory=target/allure-results
PropertyDefaultDescription
allure.results.directorytarget/allure-resultsDirectory where Allure writes raw JSON result files during a test run. The allure:report goal reads from this path.
The Surefire plugin also sets allure.results.directory as a system property. The system property takes precedence over allure.properties, so both point to the same directory by default. If you change one, change the other.

TestRunner.java

Located at src/test/java/runners/TestRunner.java.
@CucumberOptions(
        features = "classpath:features",
        glue = {"steps", "hooks"},
        tags = "@smoke",
        plugin = {
                "pretty",
                "io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm"
        }
)
public class TestRunner extends AbstractTestNGCucumberTests {
}

@CucumberOptions reference

features
String
Path to the Gherkin feature files. classpath:features resolves to src/test/resources/features/. All .feature files in that directory tree are loaded.
glue
String[]
Packages that Cucumber scans for step definitions and hooks. "steps" covers step definition classes; "hooks" covers the Hooks class. Add new packages here if you create step definitions outside these packages.
tags
String
Cucumber tag expression that filters which scenarios to run. Currently set to "@smoke", so only scenarios tagged @smoke execute. Set to an empty string or remove the attribute to run all scenarios.
plugin
String[]
Reporting plugins. "pretty" prints formatted Gherkin output to the console. AllureCucumber7Jvm writes per-step result JSON files consumed by allure:report.

Changing the tag filter

Edit the tags attribute in TestRunner.java:
// Run all scenarios
tags = ""

// Run only regression tests
tags = "@regression"

// Run smoke but not slow tests
tags = "@smoke and not @slow"

// Run smoke or regression
tags = "@smoke or @regression"
You can also override the tag at the command line without editing the file:
mvn test -Dcucumber.filter.tags="@regression"

Changing the Allure results directory

Update the path in both allure.properties and the <systemPropertyVariables> block in pom.xml:
# allure.properties
allure.results.directory=target/my-custom-results
<!-- pom.xml -->
<allure.results.directory>${project.build.directory}/my-custom-results</allure.results.directory>

System properties accepted at runtime

PropertyHow to setDescription
cucumber.filter.tags-Dcucumber.filter.tags="@tag"Overrides the tags value in TestRunner.java
allure.results.directory-Dallure.results.directory=pathOverrides the Allure output path
webdriver.chrome.driver-Dwebdriver.chrome.driver=/path/to/chromedriverPoints Selenium to a specific ChromeDriver binary (not needed with Selenium 4)

Build docs developers (and LLMs) love