Cucumber HTML 报告带有时间戳的文件夹

Cucumber HTML reports folder with timestamp

       <plugin>
            <groupId>net.masterthought</groupId>
            <artifactId>maven-cucumber-reporting</artifactId>
            <version>${masterThougth.version}</version>
            <executions>
                <execution>
                    <id>execution</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <checkBuildResult>false</checkBuildResult>
                        <projectName>${project.artifactId}</projectName>
                        <buildNumber>${project.build}</buildNumber>
                        <parallelTesting>true</parallelTesting>
                        <outputDirectory>target/cucumber-report/</outputDirectory>
                        <cucumberOutput>target/cucumber-report/</cucumberOutput>
                    </configuration>
                </execution>
            </executions>
        </plugin>

我正在使用上面的 Maven Cucumber 插件来生成 HTML 测试 report.How 我可以为不同的运行生成具有不同时间戳的 Cucumber 报告(文件夹)。

您可以试试下面的代码。

  <properties>
     <timestamp>${maven.build.timestamp}</timestamp>
     <maven.build.timestamp.format>yyyy_MM_dd_HH_mm</maven.build.timestamp.format>
  <properties>

    <plugin>
        <groupId>net.masterthought</groupId>
        <artifactId>maven-cucumber-reporting</artifactId>
        <version>${masterThougth.version}</version>
        <executions>
            <execution>
                <id>execution</id>
                <phase>verify</phase>
                <goals>
                    <goal>generate</goal>
                </goals>
                <configuration>
                    <checkBuildResult>false</checkBuildResult>
                    <projectName>${project.artifactId}</projectName>
                    <buildNumber>${project.build}</buildNumber>
                    <parallelTesting>true</parallelTesting>
                    <outputDirectory>target/cucumber-report/${timestamp}</outputDirectory>
                    <cucumberOutput>target/cucumber-report/</cucumberOutput>
                </configuration>
            </execution>
        </executions>
    </plugin>