2

I've got the following jacoco-maven-plugin configuration:

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco.version}</version>
        <configuration>
          <excludes>
            <exclude>**/Header*.java</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

Which should exclude from a code coverage report all generated java files that begin with Header. Unfortunately, I still see these classes in my code coverage report which makes the coveralls-maven-plugin fail when I call the coveralls:report. The error I get when I call coveralls:report is:

: No source found for HeaderMyClass.java ->

Which makes me think that the JaCoCo coverage report still contains the data for this class which was automatically generated.

Shmoe
  • 31
  • 1
  • 3

2 Answers2

2

Just add exclusions for report goal in jacoco-maven-plugin configuration

<execution>
  <id>coverage-report</id>
  <phase>post-integration-test</phase>
  <goals>
    <goal>report</goal>
  </goals>
  <configuration>
    <excludes>
      <exclude>**/*Dto.class</exclude>
      <exclude>com/foo/config/*</exclude>
    </excludes>
  </configuration>
</execution>
Radek M
  • 379
  • 2
  • 8
1

Changing the pattern to:

  <excludes>
    <exclude>**/Header*.*</exclude>
  </excludes>

did the trick

Shmoe
  • 31
  • 1
  • 3