How can *.1 classes be ignored in Jacoco coverage?
I have the following in my POM:
<execution>
<id>JaCoco Coverage Enforcement</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/coverage-reports/jacoco-unit.exec</dataFile>
<excludes>
<exclude>**/MyClass.**</exclude>
</excludes>
<rules>
...
</rules>
</execution>
However, I get the following error message:
[WARNING] Rule violated for class com.mypackage.MyClass.1: lines covered ratio is 0.00, but expected minimum is 0.85
Update 12/19
Here's what's in the folder structure:
$ find . -iname 'MyClass*class'
./target/classes/com/mypackage/MyClass$1.class
./target/classes/com/mypackage/MyClass.class
Exclusion pattern for
verify
goal can be**/MyClass$**
if you want to exclude only fileMyClass$1.class
(note the dollar sign in place, where you had the dot). If you want to exclude bothMyClass.class
andMyClass$1.class
, then pattern can be**/MyClass**
.