'maven jacoco plugin reports always show 0% of coverage

JaCoCo reports always shows 0% of coverage but Intellij integrated report is ok. I already see others StackOverflow questions but none helped. Below is my jacoco-plugin and surefire-plugin snnipet from pom.xml configuration:

EDIT:

        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.2</version>
            <configuration>
                <runOrder>balanced</runOrder>
                <parallel>classes</parallel>
                <threadCount>4</threadCount>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.apache.maven.surefire</groupId>
                    <artifactId>surefire-junit47</artifactId>
                    <version>2.22.2</version>
                </dependency>
            </dependencies>
        </plugin>

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

My last attempts were order surefire and jacoco-plugin but it doesn't work. There is any relation with surefire and jacoco-plugin?



Solution 1:[1]

I solved it a long time ago, but seeing the code now I viewed that I added among other things the report goal in jacoco-maven-plugin

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Abilio Castro