问题
Background info:
- Maven version: 3.2.5
- Java version: 1.8
- Cucumber reporting version: 3.8.0
I have a multi-module maven java project. I have cucumber tests and the maven-cucumber-reporting plugin running and working for each module.
Question: I would like to generate one large report with all cucumber.json files from the child modules included after all child modules have built.
Can I:
- Run a maven plugin in the parent pom after all child modules have built and tested (with cucumber.json files created) to aggregate these reports into one large report
- Use a child module run at the end to do the aggregation of all child cucumber.json files and generate one big report.
Thanks in advance for any help!
回答1:
- Yes you can generate reports in the main pom. But you have to put all your sub module json reports into common directory so that report plugin takes all json file in the directory and generate consolidated report. Current maven cucumber report plugin accepts only one file or directory as input. Make sure all sub modules reports are in the same folder as mentioned in the report plugin.
- Otherwise we can generate the report in the last module using report API. But you should put last module is depend on all previous modules.
- If you put child module to generate report then make sure all other modules are generated the json reports before executing the child module.
来源:https://stackoverflow.com/questions/44550153/maven-cucumber-reporting-with-multi-module-maven-project