4

我曾多次尝试在 Gradle 中配置此 sonarqube 属性sonar.junit.reportPaths,但仍然收到相同的错误消息。
Gradle 版本 -> 6.7.1
SonarQube Server 版本 -> 8.9 (docker image)
Java 版本 -> openjdk 11.0.2
Intellij 版本 -> 2021.1.2
我的 Sonarqube Gradle 配置如下:

plugins {
    id 'java'
    id 'jacoco'
    id "org.sonarqube" version "3.3"
    id 'org.jetbrains.kotlin.jvm' version '1.5.20'
}

sonarqube {
    properties {
        property 'sonar.projectName', 'Snippets of Java code'
        property 'sonar.junit.reportPaths', 'build/test-results/test'
        property 'sonar.coverage.jacoco.xmlReportPaths', 'build/reports/test/jacocoTestReport.xml'
        property 'sonar.inclusions', '*.java,*.kt'
    }
}

jacocoTestReport {
    reports {
        xml.required = true
        csv.required = false
    }
}

我仍然收到以下消息:

Resource not found: com.sammy.service.JavaFareTest under the directory /Users/samuelifere/IdeaProjects/codingChallenges while reading test reports. Please, make sure your "sonar.junit.reportPaths" property is configured properly
Resource not found: com.sammy.model.JavaCardTest under the directory /Users/samuelifere/IdeaProjects/codingChallenges while reading test reports. Please, make sure your "sonar.junit.reportPaths" property is configured properly

我阅读了几个 stackoverflow 页面,例如: 12但仍然无助于解决我的问题。任何帮助将不胜感激,因此它可以正确找到资源。

我用来通过 Gradle 运行的命令是:

./gradlew clean build jacocoTestReport sonarqube
4

0 回答 0