如何使用JaCoCo忽略内部/嵌套类?

Tor*_*que 6 java code-coverage inner-classes jacoco

我试图忽略一些生成的类,并且这些类被忽略了.但是如果这些类具有内部类,那么尽管排除了父类,但仍然包括这些类.这是我的配置:

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.7.9</version>
    <executions>
        <execution>
            <goals>
                <goal>prepare-agent</goal>
            </goals>
        </execution>
        <execution>
            <id>report</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>report</goal>
            </goals>
            <configuration>
                <excludes>
                    <exclude>**/*DB.*</exclude>
                    <exclude>**/*DTO.*</exclude>
                </excludes>
            </configuration>
        </execution>
    </executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)

尝试通过排除使用ParentClass.NestedClass的标准Java名称约定**/*DB.*.*没有帮助.

Tor*_*que 25

经过一番搜索,我自己找到了答案.因为它不容易谷歌,我把它放在这里为了后人的缘故:

语法镜像了编译的 Java命名约定:

<configuration>
    <excludes>
        <exclude>**/*DB.*</exclude>
        <exclude>**/*DB$*.*</exclude>
        <exclude>**/*DTO.*</exclude>
        <exclude>**/*DTO$*.*</exclude>
    </excludes>
</configuration>
Run Code Online (Sandbox Code Playgroud)