war文件位于tomcat7 / webapps /中。我在pom.xml中进行了以下更改:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.5.5.201112152213</version>
<configuration>
<destFile>${basedir}/../../../../../../opt/tomcat7/webapps/coverage-reports/jacoco-unit.exec</destFile>
<dataFile>${basedir}/../../../../../../opt/tomcat7/webapps/coverage-reports/jacoco-unit.exec</dataFile>
<outputDirectory>${basedir}/../../../../../../opt/tomcat7/webapps/coverage-reports/jacoco</outputDirectory> </configuration>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
使用上述内容构建项目后,将在tomcat7 / webapps中创建一个包含index.html的文件夹。但同样继续提供0%的覆盖率报告。我有什么问题吗?
答案 0 :(得分:0)