为了提供一个更好的 JaCoCo 单测报告,我们可以将一些无业务逻辑的代码(PO,DTO等)从单测报告中移除。
如下面配置,通过在 configuration -> excludes -> exclude 排除相关包路径即可。
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<configuration>
<excludes>
<exclude>com.example.domain.*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
官方文档说明地址 https://www.baeldung.com/jacoco-report-exclude
计算小于非负整数n的质数数量Example:Input: 10
Output: 4
Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.1:算法思想参考
这个算法的过程如下图所示,我们从2开始遍历到根号n,先找到第一个质数2,然后将其所有的倍数全部标记出来,然后到下一个质数3,标记其所有倍数,一次类推,直
javascript 绑定键盘 js绑定this
前言:上一篇简单说了this的飘忽不定,有时,需要把this固定下来,避免出现意想不到的情况。JavaScript 提供了call、apply、bind这三个方法,来切换/固定this的指向。(出来混总是要还的)。1、call()函数实例的call方法,可以指定函数内部this的指向(即函数执行时所在的作用域),然后在所指定的作用域中,调用该函数。var obj = {};
var f = fu