SonarQube 和 Jacoco 无法识别 kotlin-classes 目录

我正在使用 Jacoco v0.8.4和 Sonarcube v2.7.1。


我正在为 SonarCube 使用以下配置。


property "sonar.sources", "src/main/java"

property "sonar.binaries","build/intermediates/javac,app/build/tmp/kotlin-classes"

property "sonar.java.binaries", "build/intermediates/javac,app/build/tmp/kotlin-classes"

property "sonar.tests", "src/test/java" // where the tests are located

property "sonar.java.test.binaries", "build/intermediates/javac,app/build/tmp/kotlin-classes"

property "sonar.jacoco.reportPath", "build/jacoco/testDevDebugUnitTest.exec"

property "sonar.java.coveragePlugin", "jacoco"

property "sonar.android.lint.report", "build/reports/lint results.xml"
     


SonarCube 分析失败,原因是sonar.java.binaries的值无效


> No files nor directories matching 'app/build/tmp/kotlin-classes'



但是我的项目文件夹中存在“app/build/tmp/kotlin-classes” 。


但是,如果我kotlin从属性中删除内容,那么它会成功地覆盖 Java 文件。


我对 Kotlin 的报道做错了什么吗?


米琪卡哇伊
浏览 169回答 1
1回答

森栏

您还需要在下面的路径中添加构建变体文件夹property "sonar.java.test.binaries", "build/intermediates/classes/test/, app/build/tmp/kotlin-classes/<BuildVariant>UnitTest"property "sonar.java.binaries", "build/intermediates/classes/<BuildVariant>/, app/build/tmp/kotlin-classes/<BuildVariant>/"property "sonar.binaries", "build/intermediates/classes/<BuildVariant>/, app/build/tmp/kotlin-classes/<BuildVariant>/"还有一件事尽量避免使用带有空格的文件名lint results.xml&nbsp;&nbsp;&nbsp;&nbsp;
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java