all answers above a way too complicated an totaly unnecessary, because:
The only thing you have to make sure is, that the report is generated after the integration-test phase.
Because by default the Jacoco report is run before the integration-test phase.
Surprisingly enough, this:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<executions>
<execution>
<id>jacoco-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<!-- needed in order to make the report also include the results from the integration tests -->
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
already adds the additional necessary command line parameters for coverage measuring not only to the unit-tests but also to the integration-tests. But since the report is generated by default before integration-tests their coverage is not included in the test by default.
So just adding this:
<execution>
<id>jacoco-report</id>
<!-- needed in order to make the report also include the results from the integration tests -->
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
is already sufficient to add the integration-tests coverage to the report.
All the claims on the internet, and in chatGPT for a much more complicated configuration using Jacocos merge
goal or defining <argLine>${argLine}</argLine>
for surefire-plugin
or <argLine>${failsafe.argLine}</argLine>
for the fail-safe-plugin
is not necessary at all!