Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added class data
Source Link
el n00b
  • 1.9k
  • 8
  • 44
  • 75

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 

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

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 
Source Link
el n00b
  • 1.9k
  • 8
  • 44
  • 75

Jacoco - ignore MyClass.1

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