JaCoCO execution is skipped

402 views
Skip to first unread message

Rostislav Alpin

unread,
Sep 1, 2023, 10:43:23 AM9/1/23
to JaCoCo and EclEmma Users
Good day!
I am getting the error "Skipping JaCoCo execution due to missing execution data file."
This is the message I am getting during test executions; hence, reports are not generated.
I have tried multiple variations of plugins. Below is one of the basic plugins:
<plugin>
<groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.10</version> <executions> <execution> <goals> <goal>prepare-agent</goal> </goals> </execution> <!-- attached to Maven test phase --> <execution> <id>report</id> <phase>test</phase> <goals> <goal>report</goal> </goals> <configuration> <!-- Sets the path to the file which contains the execution data. --> <dataFile>${basedir}/mqe-unified-platform-brand-tests/target/jacoco.exec</dataFile> <!-- Sets the output directory for the code coverage report. --> <outputDirectory>${basedir}/mqe-unified-platform-brand-tests/target/my-reports</outputDirectory> </configuration> </execution> </executions> </plugin>

After adding the plugin, executed the tests using Maven.
The below command is used to run a particular test by specifying the test case ID.
`mvn clean test -pl mqe-unified-platform-brand-tests -am -Dgroups=22623656`
Even if the data "file path" is provided explicitly in the plugin, I was getting the same message in the terminal.
Please advise.

Rostislav Alpin

unread,
Sep 1, 2023, 11:12:07 AM9/1/23
to JaCoCo and EclEmma Users
PS.
The above execution was made based on the assumption that JaCoCo doesn't require access to the source code.

Marc Hoffmann

unread,
Sep 1, 2023, 2:15:27 PM9/1/23
to JaCoCo and EclEmma Users
Hi,

hard to tell from this snippet what is going on here. My first guess is that when you configure a different location for the report goal you must also specify that locaton on the prepare-agent goal (“destfile”). See documentation: https://www.jacoco.org/jacoco/trunk/doc/prepare-agent-mojo.html

Regards,
-marc



--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/00524f7e-ff2e-4fcb-9dc5-130160e48e31n%40googlegroups.com.

Rostislav Alpin

unread,
Sep 3, 2023, 1:56:52 PM9/3/23
to JaCoCo and EclEmma Users
Hi Marc,
I updated the "prepare-agent as you suggested but still no reports generated.
My current plaugin looks as below, please take a look and tell if you see that anything is off
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<executions>
<execution>
<id>jacoco-prepare-agent</id>

<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution data. -->
<classDumpDir>${basedir}/mqe-unified-platform-brand-tests/target/jacoco.classDumpDir</classDumpDir>

<!-- Sets the output directory for the code coverage report. -->
<destFile>${basedir}/mqe-unified-platform-brand-tests/target/my-reports/jacoco.exec</destFile>
</configuration>
</execution>
<execution>
<id>jacoco-report</id>

<goals>
<goal>report</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution data. -->

<dataFile>${basedir}/mqe-unified-platform-brand-tests/target/jacoco.exec</dataFile>
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>${basedir}/mqe-unified-platform-brand-tests/target/my-reports</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

Rostislav Alpin

unread,
Sep 4, 2023, 6:52:39 AM9/4/23
to JaCoCo and EclEmma Users
Sorry forgot to mention, that after updating the plugin, I have no error message anymore, but my-reports folder is not generated with logs. Any suggestions, on how to move this forward
Reply all
Reply to author
Forward
0 new messages