你的pom.xml中jacoco的配置是什么?
你检查一下你报道的路径了吗?
来自sonarqube的示例代码显示了如何使用Jacoco获得UT,IT和覆盖: http://docs.sonarqube.org/display/PLUG/Code+Coverage+by+Integration+Tests+for+Java+Project
https://github.com/SonarSource/sonar-examples/tree/master/projects/languages/java/code-coverage/combined%20ut-it/combined-ut-it-multimodule-maven-jacoco
我认为在pom.xml中设置属性比使用-D参数更好...
<properties> <!-- select JaCoCo as a coverage tool --> <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> <!-- force sonar to reuse reports generated during build cycle --> <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis> <!-- set path for unit tests reports --> <sonar.jacoco.reportPath>${project.basedir}/target/jacoco-unit.exec</sonar.jacoco.reportPath> <!-- all modules have to use the same integration tests report file --> <sonar.jacoco.itReportPath>${project.basedir}/../target/jacoco-it.exec</sonar.jacoco.itReportPath> </properties>