2017-03-16 14 views
0

모듈 A의 일부 통합 테스트를 실행 중입니다. 모듈 B의 모든 클래스를 가져 오는 중이며, 관심있는 부분은 B의 일부 패키지뿐만 아니라 일부 패키지를 추가하는 것입니다. A.에서 패키지실행중인 통합 모듈의 패키지가 제외되지 않았습니다.

미안 jacocco 플러그인에서 제외를 사용하고 미안은 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의 모든 패키지가 왜 전자가 아닌지 알 수 있습니다. xcluded?

답변

1

prepare-agent-integrationexclusions을 구성하면 패키지가 계측에서 제외되어야하며 보고서에서는 제외되어야한다고 지정했습니다. report-integration 대신 exclusions을 구성해야합니다.

+0

거기에 넣으려고해도 아무 것도 없지만 여전히 보고서 폴더 coverage-reports/out /에 소스를 추가합니다. jacoco it'sa mess, 또는 muy 유스 케이스에 관한 모든 것 bizzar – paul

+0

@paul이 경우에는 ** complete ** 및 ** verifiable ** example (http://stackoverflow.com/help/mcve)을 제공하십시오. 'pom.xml'을 부분적으로 발췌하면 문제를 재현하고 이해하는 데 충분하지 않습니다. – Godin