Java – allure: the environment files in the target folder are deleted on Maven clean How do I generate it at each build?

Description indicates that the environment XML is added to the allure results directory( https://github.com/allure-framework/allure-core/wiki/Environment )However, this folder was deleted on MVN clean, so the file will be deleted Is there any way to generate this file at each build?

thank you.

Solution

Just enter your Src / main / resources / and copy it to your results directory through MVN test or Maven resources plugin on MVN site:

<plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <executions>
        <execution>
            <id>copy-allure-environment</id>
            <phase>pre-site</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>
            <configuration>
                <outputDirectory>${basedir}/target/allure-results</outputDirectory>
                <resources>
                    <resource>
                        <directory>src/main/resources</directory>
                        <includes>
                            <include>environment.xml</include>
                        </includes>
                    </resource>
                </resources>
            </configuration>
        </execution>
    </executions>
</plugin>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>