'Allure is not generating report on cucumber 7

After updating the cucumber version to 7.2.3, Allure not generating reports. (unknown report and NaN%). It still uses the config file in the directory. I think it's not about the folder path. If I decrease the version to 5.6.0 it is working.

The related part of the pom.xml is like below.

Does anyone have a solution for this??

Thanks,

<dependencies>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>7.2.3</version>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>7.2.3</version>
        </dependency>
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-cucumber7-jvm</artifactId>
            <version>2.17.3</version>
        </dependency>
<dependencies>
 <argLine>
    -Dcucumber.options="--plugin io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm                
 </argLine>


Solution 1:[1]

I know that it doesn't answer the exact question but hope it can help somebody.

I had the same issue with Gradle - build/allure-results folder had only one small json file that generated empty allure report. It seems like not all the Cucumber and Allure versions are compatible with each other. So I have found a compatible versions pair of Cucumber and Allure. Surprisingly they are the same as author has:

cucumberVersion = '7.2.3'
allureVersion = '2.17.3'

related part of my build.gradle:

plugins {
    id 'java'
    id 'io.qameta.allure' version '2.9.1'
}

apply plugin: 'io.qameta.allure'

dependencies {
    implementation group: 'io.cucumber', name: 'cucumber-java', version: '7.2.3'
    testImplementation group: 'io.cucumber', name: 'cucumber-java', version: '7.2.3'
    implementation group: 'io.qameta.allure', name: 'allure-cucumber7-jvm', version: '2.17.3'
}

configurations {
    cucumberRuntime {
        extendsFrom testImplementation
    }
}

task cucumber() {
    dependsOn assemble, testClasses
    doLast {
        javaexec {
            main = "io.cucumber.core.cli.Main"
            classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
            args = ['--plugin', 'html:results.html',
                    '--plugin', 'pretty',
                    '--plugin', 'io.qameta.allure.cucumber7jvm.AllureCucumber7Jvm',
                    '--glue', 'step_definitions',
                    'src/test/resources']
        }
    }
}

Solution 2:[2]

No, no this problem is not depend any cucumber version. Allure report have to write allure-result to any folder on test executing so you can use this commandline under <argLine> raw your pom.xml.

  <systemPropertyVariables>
   <allure.results.directory>
     ${project.build.directory}/allure-results
   </allure.results.directory>
 </systemPropertyVariables>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dyadko
Solution 2 Ayhan Uzundal