I gave them a new try
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${version.jacoco}</version>
<configuration>
<excludes>
<exclude>jmeter/**/*.class</exclude>
<exclude>**/jmeter/**/*.class</exclude>
<exclude>codes/**/*.class</exclude>
<exclude>**/*Code*.class</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
The result is that the following files are taken and I has expected that
they are not considered (this is the outcome from sonar) when pushing the
results but also all these modules have jacoco/index.html and the files are
considered there.
src/main/java/com/a/b/c/jmeter/abc.java
<https://sonarci-test.mo.sap.corp:8443/sonar/dashboard?id=com.sap.retail.ppservice%3Appservice-jmeter%3Asrc%2Fmain%2Fjava%2Fcom%2Fsap%2Fppservice%2Fcloud%2Fjmeter%2FOAuthClientHelper.java>
src/main/java/com/a/b/c/codes/AbcCodes.java
<https://sonarci-test.mo.sap.corp:8443/sonar/dashboard?id=com.sap.retail.ppservice%3Appengine-cf%3Asrc%2Fmain%2Fjava%2Fcom%2Fsap%2Fppengine%2Fcf%2Fconfiguration%2Fcodes%2FPercentualPointsMethodCodes.java>
Am Mi., 16. Dez. 2020 um 21:33 Uhr schrieb Evgeny Mandrikov <
[email protected]>:
>
> On Wednesday, December 16, 2020 at 9:21:51 PM UTC+1 delcorny wrote:
>
>> Hello,
>>
>> the issue is that also all files below the path '**/test/**' is also
>> checked. So the exclude has not been taken.
>>
>> So is the wildcard in the beginning needed like **/test/**/*.class or
>> test/**/*.class.
>>
>
> Both are valid patterns for class files
> second one will match
> target/classes/A/test/B/C.class
> and
> target/classes/test/D/E.class
> while second one will match only later.
>
> I don't know which one is suitable in your case without access to your
> project.
> Either provide it or try both by yourself.
>
>
>> BR,
>> Patrick
>>
>> Am Mi., 16. Dez. 2020 um 16:05 Uhr schrieb Evgeny Mandrikov <
>> [email protected]>:
>>
>>> Please read documentation
>>> https://www.jacoco.org/jacoco/trunk/doc/report-mojo.html#excludes
>>> which states that excludes property of report goal refers to class files
>>> and not to source files:
>>> A list of *class files* to exclude from the report
>>>
>>> Instead
>>> <exclude>**/src/main/java/abc/*.java</exclude>
>>> you probably need
>>> <exclude>abc/*.class</exclude>
>>>
>>>
>>> On Wednesday, December 16, 2020 at 3:58:50 PM UTC+1 delcorny wrote:
>>>
>>>> Hello,
>>>>
>>>> I have an multi module maven project and and want to define excludes in
>>>> the parent pom. I did some entries but there is no effect. When I check the
>>>> site/jacoco/index.hmtl I still see measurements in the module I have
>>>> excludes (i.e. abc ). For other modules I also found that coding in
>>>> **/test/abc.java has been scanned.
>>>>
>>>> <profile>
>>>> <!-- Code Coverage - Jacoco -->
>>>> <id>codecoverage</id>
>>>> <build>
>>>> <plugins>
>>>> <plugin>
>>>> <groupId>org.jacoco</groupId>
>>>> <artifactId>jacoco-maven-plugin</artifactId>
>>>> <version>0.8.4</version>
>>>> <configuration>
>>>> <excludes>
>>>> <exclude>**/src/main/java/abc/*.java</exclude>
>>>> <exclude>**/test/**</exclude>
>>>> </excludes>
>>>> </configuration>
>>>> <executions>
>>>> <execution>
>>>> <id>pre-unit-test</id>
>>>> <goals>
>>>> <goal>prepare-agent</goal>
>>>> </goals>
>>>> </execution>
>>>> <execution>
>>>> <id>post-unit-test</id>
>>>> <phase>test</phase>
>>>> <goals>
>>>> <goal>report</goal>
>>>> </goals>
>>>> </execution>
>>>> </executions>
>>>> </plugin>
>>>> </plugins>
>>>> </build>
>>>> </profile>
>>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "JaCoCo and EclEmma Users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/jacoco/b1vAV3Q7wis/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jacoco/b230223a-d006-424f-a497-7fd15a330752n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jacoco/b230223a-d006-424f-a497-7fd15a330752n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "JaCoCo and EclEmma Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jacoco/b1vAV3Q7wis/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/16e6e1ab-33bb-41ab-8477-b27847a261f8n%40googlegroups.com
> <https://groups.google.com/d/msgid/jacoco/16e6e1ab-33bb-41ab-8477-b27847a261f8n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/CAMbgga_euccTX3YcY8eyk08SYBaDxhiEqSnEfQpUyU27BPJvqg%40mail.gmail.com.