Java 未为集成测试生成Jacoco-it.exec
我有多模块项目-Java 未为集成测试生成Jacoco-it.exec,java,maven,Java,Maven,我有多模块项目- 家长 1-控制器模块-具有单元测试 2-服务模块-具有单元测试 3-集成测试模块-放心Api测试 我已将jacoco集成到家长的pom.xml中。 正在为所有单元测试生成Jacoco.exec,但没有为集成测试模块生成Jacoco-it.exec。但是,正在生成surefire重新启动。如果我遗漏了什么,请告诉我?我是否需要在集成测试模块的pom.xml上添加任何内容?我所有的插件都在家长的pom.xml中 <plugin> <groupId&
家长
1-控制器模块-具有单元测试
2-服务模块-具有单元测试
3-集成测试模块-放心Api测试
我已将jacoco集成到家长的pom.xml中。
正在为所有单元测试生成Jacoco.exec,但没有为集成测试模块生成Jacoco-it.exec。但是,正在生成surefire重新启动。如果我遗漏了什么,请告诉我?我是否需要在集成测试模块的pom.xml上添加任何内容?我所有的插件都在家长的pom.xml中
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions>
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>
<propertyName>failsafeArgLine</propertyName>
</configuration>
</execution>
<execution>
<id>post-integration-test</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/coverage-reports/jacoco-it.exec</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.15</version>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<argLine>${failsafeArgLine}</argLine>
<skipTests>${skip.integration.tests}</skipTests>
</configuration>
</execution>
</executions>
</plugin>
org.jacoco
jacocomaven插件
0.7.5.201505241946
预集成测试
预集成测试
配制剂
${project.build.directory}/coverage reports/jacoco-it.exec
故障保护argline
整合后测试
整合后测试
汇报
${project.build.directory}/coverage reports/jacoco-it.exec
${project.reporting.outputDirectory}/jacoco-it
org.apache.maven.plugins
maven故障保护插件
2.15
集成测试
集成测试
验证
${failsafeArgLine}
${skip.integration.tests}
您需要在引用的故障保护配置argLine属性中使用@{failsareagline}
(因此基本上是@而不是$),否则故障保护将不会使用JaCoCo设置的属性。至少在我的项目中,这是唯一缺少的东西