java - jacoco 在 IntelliJ 终端中报告
问题描述
我使用 Maven 插件生成 Jacoco 报告。我通过在 IntelliJ 终端中调用以下命令来做到这一点:
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Dmaven.test.failure.ignore=true
乍一看,一切看起来都很好,但结果是错误的!jacoco.exec
使用“普通”控制台(cmd、bash、powershell 等)时,生成的文件要大得多。IntelliJ 版本显示的代码覆盖率要小得多,这是不正确的。
为什么 IntelliJ 结果不同,为什么它是错误的?我在两种环境中从同一位置运行完全相同的命令。这是我的 Maven 设置的一部分:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
<version>${jacoco-maven-plugin.version}</version>
</plugin>
有什么线索吗?
解决方案
推荐阅读
- android - Firebase 不会在数据库中创建新的用户数据
- c# - 从动态文件夹路径字符串构建正则表达式模式
- javascript - 从 Express 路由引发异常时未调用未处理的异常事件处理程序
- asp.net-core - ASP.NET CORE 中“TransparentNetworkIPResolution”的替代方法是什么
- dart - 飞镖中的未命名构造函数
- python - 如何在 R 中执行 k-fold CV?
- r - 如何在 R 中解决具有两种情况的 SDE?
- c# - 无法访问在同一个共享项目c#中定义的接口
- spring - Spring批处理并行运行多个作业
- c++ - 仅当字符数组获得“1000!”的输入时,C++ 程序才会在删除时崩溃