Allure:目标文件夹中的环境文件在maven clean上被删除。如何在每次构建时生成它? [英] Allure: Environment file in target folder gets deleted on maven clean. How do I generate it on every build?
本文介绍了Allure:目标文件夹中的环境文件在maven clean上被删除。如何在每次构建时生成它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
说明将environment.xml添加到Allure结果目录( https ://github.com/allure-framework/allure-core/wiki/Environment )但是这个文件夹在mvn clean上被删除,所以文件被删除了。有没有办法在每次构建时生成此文件?
The instructions say to add the environment.xml to the Allure results directory (https://github.com/allure-framework/allure-core/wiki/Environment) but this folder gets deleted on mvn clean so the files gets deleted with it. Is there a way to generate this file on every build?
谢谢。
推荐答案
只需加入 src / main / resources /
并通过 maven资源插件 mvn test
或 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>
这篇关于Allure:目标文件夹中的环境文件在maven clean上被删除。如何在每次构建时生成它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文