在eclipse中我已經使用EcLEmma來查看單元測試代碼覆蓋率。哪些工作正常。 因此,我試圖用Maven的jacoco插件從maven構建中看到同樣的報告,甚至更好地使用某個配置文件或網站週期。均以慘敗告終maven單元測試代碼覆蓋率
所有建議的解決方案在這裏並沒有爲我
是什麼讓一個UNIST測試代碼覆蓋率報告(與神火)的最佳方式工作? [編輯] 更spefici爲什麼jacoco失敗,我....我得到alswas的 跳繩JaCoCo執行由於缺少執行數據
從POM 在屬性
<jacoco.it.execution.data.file>${project.build.directory}/coverage-reports/jacoco-it.exec</jacoco.it.execution.data.file>
<jacoco.ut.execution.data.file>${project.build.directory}/coverage-reports/jacoco-ut.exec</jacoco.ut.execution.data.file>
在Build部分
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<versionRange>${jacoco.version}</versionRange>
<executions>
<!-- Prepares the property pointing to the JaCoCo runtime agent
which is passed as VM argument when Maven the Surefire plugin is executed. -->
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution
data. -->
<destFile>${jacoco.ut.execution.data.file}</destFile>
<!-- Sets the name of the property containing the settings for
JaCoCo runtime agent. -->
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<!-- Ensures that the code coverage report for unit tests is created
after unit tests have been run. -->
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution
data. -->
<dataFile>${jacoco.ut.execution.data.file}</dataFile>
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
</configuration>
</execution>
<!-- Prepares the property pointing to the JaCoCo runtime agent
which is passed as VM argument when Maven the Failsafe plugin is executed. -->
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution
data. -->
<destFile>${jacoco.it.execution.data.file}</destFile>
<!-- Sets the name of the property containing the settings for
JaCoCo runtime agent. -->
<propertyName>failsafeArgLine</propertyName>
</configuration>
</execution>
<!-- Ensures that the code coverage report for integration tests
after integration tests have been run. -->
<execution>
<id>post-integration-test</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution
data. -->
<dataFile>${jacoco.it.execution.data.file}</dataFile>
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
</configuration>
</execution>
</executions>
</pluginExecutionFilter>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
是我最後一次嘗試,但POM變得沒有任何結果越做越大
與
failes配置報告插件org.apache.maven.plugins:行家-JXR-插件:2.3
配置報告插件org.jacoco:jacoco-行家-插件:0.7.5.201505241946
跳繩JaCoCo執行由於缺少執行數據文件:...... \目標\ jacoco.exec
跳繩JaCoCo執行由於缺少執行數據文件:...... \目標\ jacoco,它.exec
....=>長項目路徑
使用類似jacoco插件或插件的Cobertura HTML報告。那是什麼?你說你已經試過了,它「失敗了」?嗯。好吧,如果我知道什麼「失敗慘敗」*看起來像*我可能會有所幫助,但是事實上,我猜你已經不幸運了。 – dcsohl
你使用'jacoco-maven-plugin'?請解釋你做了什麼,然後嘗試了一下,然後我們可能會馬上幫忙。 – RobAu
將jacoco的pom碎片添加到問題 – user3732793