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?
Thanks.
for me, the phase "pre-site" didn't work the correct phase is validate my resources are on the src\test\java\resoruces here is a working answer from my pom.xml file
Disclosure: I've created Java library which deals with this issue: https://github.com/AutomatedOwl/allure-environment-writer
It uses TransformerFactory to write the environment.xml to the allure-results path in any stage of the test. It also checks for the directory existence in case running from cleaned build.
Usage example:
Just put in in your
src/main/resources/
and copy to your results directory via maven resources plugin onmvn test
ormvn site
: