不排除运行集成模块的包

时间:2017-03-16 16:05:07

标签: jacoco jacoco-maven-plugin

我正在从模块A运行一些集成测试,首先获得模块B中的所有类,我感兴趣的是没有添加来自B的一些软件包,还有来自A的一些软件包。

我在jacocco插件中使用了排除,我从B指定的所有包都完美地排除了,但来自A的那些包没有

这是我的配置

  <plugin> 
                <groupId>org.jacoco</groupId> 
                <artifactId>jacoco-maven-plugin</artifactId> 
                <version>0.7.7.201606060606</version> 
                <executions> 
                    <execution> 
                        <id>prepare-jacoco-service-test-agent</id> 
                        <!-- default pre-integration is to late for the process-exec-maven-plugin --> 
                        <phase>package</phase> 
                        <goals> 
                            <goal>prepare-agent-integration</goal> 
                        </goals> 
                        <configuration> 
                            <propertyName>failsafe.argLine</propertyName> 
                            <includes> 
                                <include>com.in*</include> 
                            </includes> 
                            <excludes> 
                                <exclude>com.B.dg.*</exclude> 
                                <exclude>com.B.es.core.server.vertx.*</exclude> 
                                <!--f2e-core-test--> 
                                <exclude>com.B.es.client.service.*</exclude> 
                                <exclude>com.B.es.core.service.test.*</exclude> 
                                <exclude>com.B.es.core.test.helper.*</exclude> 
                                <exclude>com.B.es.coretest.*</exclude> 
                                <!--f2e-mock--> 
                                <exclude>com.A.f2e.*</exclude> 
                            </excludes> 
                            <classDumpDir>${project.build.outputDirectory}</classDumpDir> 
                            <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile> 
                            <append>true</append> 
                        </configuration> 
                    </execution> 

                    <execution> 
                        <id>report-jacoco-service-test-results</id> 
                        <goals> 
                            <goal>report-integration</goal> 
                        </goals> 
                        <phase>verify</phase> 
                        <configuration> 
                            <dataFile>${project.build.directory}/coverage-reports/jacoco-it.exec</dataFile> 
                            <outputDirectory>${project.build.directory}/coverage-reports/out/</outputDirectory> 
                        </configuration> 
                    </execution> 
                </executions> 
            </plugin> 

知道为什么不排除任何模块A包?

1 个答案:

答案 0 :(得分:1)

通过为exclusions配置prepare-agent-integration,您指定应将软件包从检测中排除,而不是从报告中排除。您需要为exclusions配置report-integration