maven - 执行 Maven 构建时 Maven 跳过生成报告
问题描述
我在项目中定义了几个报告插件,当我执行 Maven → 构建失败时,FileNotFoundException
当我执行 Maven → 清理时报告被清除。有没有办法在进行 Maven 构建时忽略报告,以便构建通过而没有任何问题?我尝试使用 Surefire 插件,但没有运气。
我的pom.xml
样子是这样的:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.1</version>
<configuration>
<skip>${maven-site-plugin.skip}</skip>
<skipDeploy>true</skipDeploy>
</configuration>
</plugin>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.19.1</version>
</plugin>
</plugins>
</reporting>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>3.2.0</version>
</dependency>
解决方案
对于 maven-surefire 在版本之后添加
<configuration>
<skipTests>true</skipTests>
</configuration>
推荐阅读
- html - 线性渐变边框问题
- regex - 我如何将我的正则表达式改进为 grep 三级域,但最后没有额外的字符?
- google-smart-home - 针对恒温器报告状态问题的 Google 智能家居操作
- javascript - 如何在渲染之前在实例上定义属性或方法
- html - 如何在 HTML 样式中包含 CSS 样式(通过 ASP.Net MVC Razor 页面生成的代码)
- laravel - 无效的道具:道具“活动”的类型检查失败。预期的布尔值,得到值为“true”的字符串
- php - 从 json_url 获取数据以及如何插入到我的 mysql 数据库
- visual-studio-code - 如何避免在vs代码中显示前导和尾随空格
- php - PHP - MySql:如何在 db 中存储来自 [输入文本] 和 [下拉值] 的值
- java - 无法弄清楚为什么此测试在向 ArrayList 添加项目时失败