我有用Java版本1.8编写的微服务,并且想将Codecoverage添加到我的Jenkins-Pipeline中。是否有可用于Lambda表达式/流的Java Codecoverage工具?我正在测试Cobertura,但它直接忽略了每个带有Lambda / Stream Imports的类。我尝试使用,但是对我没用?
你们有没有推荐的工具?
这是我的Jacoco设置,也许有人知道为什么它不起作用
<project>
...
<build>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<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>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules><!-- implementation is needed only for Maven 2 -->
<rule implementation="org.jacoco.maven.RuleConfiguration">
<element>BUNDLE</element>
<limits><!-- implementation is needed only for Maven 2 -->
<limit implementation="org.jacoco.report.check.Limit">
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>0.60</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</build>
</project>
$mvn clean test jacoco:report