Lavanya Namburi
Lavanya Namburi

Reputation: 31

Jacoco code coverage report showing wrong

When I run individual test classes, it shows 100% coverage where as when I taken maven build for whole project then Jacoco report showing wrong coverage percentage for many classes. Is there a way to get jacaco report per test class?

Below is my pom configuration

      <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.6</version>
            <executions>
                <execution>
                    <id>default-prepare-agent</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
                <execution>
                    <id>default-report</id>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>  

Upvotes: 3

Views: 5025

Answers (1)

Lavanya Namburi
Lavanya Namburi

Reputation: 31

I followed the steps in below link and it solved the issue. Note, mine was a multi module project and i wanted code coverage as a single report for all modules.

https://giri-tech.blogspot.com/2021/08/maven-multi-module-java-project-code.html

Upvotes: 0

Related Questions