简体   繁体   中英

Sonarqube and Jacoco Gradle Plugins

I'm using

https://docs.gradle.org/4.2.1/userguide/jacoco_plugin.html

and

https://plugins.gradle.org/plugin/org.sonarqube/2.6.2

In a java app.

Running './gradlew build jacocoTestreport sonarqube' works fine, I can see my code coverage in sonarqube.

My question is how though?

I don't declare the sonar.jacoco.reportPaths, so that defaults to build/jacoco/test.exec, which is created by the jacocoTestReport task.

So does sonarqube run that exec or something? Or does that jacoco.exec know where the xml reports have been created at build/reports/jacoco/test/jacocoTestReport.xml?

Or, is that XML path some other sort of default that sonarqube is using?

It's all working, so great, but I'm documenting it all for others and a bit confused as to how it all hangs together.

Gradle 的 SonarQube 插件将找到查看 Jacoco 任务上下文的路径,然后自动设置 sonar.jacoco.reportPaths 属性。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM