2017-03-16 45 views
0

我正在運行模塊A的一些集成測試,首先從模塊B獲取所有類,我感興趣的是不從B中添加一些包,但也有一些包從A來自運行集成模塊的包不排除

I'm使用排除在jacocco插件,以及所有I'm從b指定包完美exlude,但是從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的任何包它不是e xcluded?

回答

1

通過爲prepare-agent-integration配置exclusions您指定軟件包應該從檢測中排除,但不能從報告中排除。您需要改爲配置exclusions代替report-integration

+0

我試圖放在那裏也沒有,仍然在報告文件夾coverage-reports/out /中添加源代碼。所有關於jacoco it'sa亂七八糟,或者可能是muy用例它是bizzar – paul

+0

@paul在這種情況下,請提供**完整的**和**可驗證的**示例(http://stackoverflow.com/help/mcve)這表明你的困難 - 「pom.xml」的部分摘錄顯然不足以重現和理解你的問題。 – Godin