2014-09-02 71 views
0

我有一個多模塊Java Maven項目,其中一個模塊包含集成測試。我使用了jacoco-maven-plugin併成功地在該模塊中生成了jacoco-it.exec。但由於某種原因,html報告沒有創建。另外聲納不讀這個報告。Jacoco IT報告創建,但沒有html

它適用於單元測試,但不適用於集成測試。

這是我加入的pom.xml:

<plugin> 
     <groupId>org.jacoco</groupId> 
     <artifactId>jacoco-maven-plugin</artifactId> 
     <version>0.7.1.201405082137</version> 
     <executions> 
      <execution> 
       <id>default-prepare-agent</id> 
       <goals> 
        <goal>prepare-agent</goal> 
       </goals> 
      </execution> 
      <execution> 
       <id>default-report</id> 
       <phase>prepare-package</phase> 
       <goals> 
        <goal>report</goal> 
       </goals> 
      </execution> 
      <execution> 
       <id>default-check</id> 
       <goals> 
        <goal>check</goal> 
       </goals> 
       <configuration> 
        <rules> 
         <rule implementation="org.jacoco.maven.RuleConfiguration"> 
          <element>BUNDLE</element> 
          <limits> 
           <limit implementation="org.jacoco.report.check.Limit"> 
            <counter>COMPLEXITY</counter> 
            <value>COVEREDRATIO</value> 
            <minimum>0.1</minimum> 
           </limit> 
          </limits> 
         </rule> 
        </rules> 
       </configuration> 
      </execution> 
      <execution> 
       <id>default-prepare-agent-integration</id> 
       <phase>pre-integration-test</phase> 
       <configuration> 
        <destFile>target/jacoco-it.exec</destFile> 
        <propertyName>failsafe.argLine</propertyName> 
       </configuration> 
       <goals> 
        <goal>prepare-agent-integration</goal> 
       </goals> 
      </execution> 
      <execution> 
       <id>default-report-integration</id> 
       <phase>post-integration-test</phase> 
       <goals> 
        <goal>report-integration</goal> 
       </goals> 
      </execution> 
     </executions> 
    </plugin> 
    <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-failsafe-plugin</artifactId> 
     <version>2.16</version> 
     <configuration> 
      <argLine>${failsafe.argLine}</argLine> 
     </configuration> 
     <executions> 
      <execution> 
       <id>default-integration-test</id> 
       <goals> 
        <goal>integration-test</goal> 
       </goals> 
      </execution> 
      <execution> 
       <id>verify</id> 
       <goals> 
        <goal>verify</goal> 
       </goals> 
      </execution> 
     </executions> 
    </plugin> 

回答