Hi Margarita,
I set -Dsonar.scanner.dumpToFile=out.properties
first via the command line, and then via the sonar.properties
block in my root ‘build.gradle.kts’, but every time I ran gradlew build sonar
the build completed abnormally quickly, and I didn’t see an ‘out.properties’ file.
After several attempts thinking I must be doing something wrong, or was dealing with some Gradle cache invalidation issue, I finally turned on --info
. Then I saw that file isn’t dumped to the project root directory or present working directory, but to your ‘$GRADLE_USER_HOME\daemon\$GRADLE_VERSION’ directory:
Simulation mode. Configuration written to C:\Dev\.gradle\daemon\8.7\out.properties
That log line explains a lot, namely why the sonar
task was completing so quickly, and that the file was actually being written out, just to an unexpected location. It would be helpful if instead of at INFO
level, that was logged at LIFECYCLE
or QUIET
level. It would also help if there was a note in the docs about the dump file going to your $GRADLE_USER_HOME\daemon
dir.
The file has more project details in it than I can share publicly, but I could send it to you directly. I don’t see a way to initiate a direct message here in the forums, but perhaps you can on your end.
Alternatively, based on the “Show SonarScanner Context” note in the docs, I copied the properties from my server. The format there is more readable than the dumpToFille
format, so I was able to produce this redacted subset that includes the two modules with the three problematic tests:
Plugins:
Bundled analyzers:
- Clean as You Code 2.2.2.656 (cayc)
- IaC Code Quality and Security 1.22.0.7057 (iac)
- PL/SQL Code Quality and Security 3.11.0.6370 (plsql)
- Scala Code Quality and Security 1.15.0.4655 (sonarscala)
- C# Code Quality and Security 9.13.0.79967 (csharp)
- Vulnerability Analysis 10.3.0.27281 (security)
- Java Code Quality and Security 7.27.1.33504 (java)
- HTML Code Quality and Security 3.11.0.4708 (web)
- Flex Code Quality and Security 2.12.0.4568 (flex)
- XML Code Quality and Security 2.10.0.4108 (xml)
- Text Code Quality and Security 2.7.1.1388 (text)
- VB.NET Code Quality and Security 9.13.0.79967 (vbnet)
- Swift Code Quality and Security 4.11.0.6055 (swift)
- CFamily Code Quality and Security 6.50.0.64514 (cpp)
- Python Code Quality and Security 4.10.0.13725 (python)
- Dataflow Bug Detection Rules for Python 1.19.0.6564 (dbdpythonfrontend)
- Dataflow Bug Detection 1.19.0.6564 (dbd)
- Go Code Quality and Security 1.15.0.4655 (go)
- JaCoCo 1.3.0.1538 (jacoco)
- Kotlin Code Quality and Security 2.18.0.2938 (kotlin)
- Dataflow Bug Detection Rules for Java 1.19.0.6564 (dbdjavafrontend)
- T-SQL Code Quality and Security 1.11.0.6885 (tsql)
- JavaScript/TypeScript/CSS Code Quality and Security 10.9.0.24449 (javascript)
- Ruby Code Quality and Security 1.15.0.4655 (ruby)
- Vulnerability Rules for C# 10.3.0.27281 (securitycsharpfrontend)
- Vulnerability Rules for Java 10.3.0.27281 (securityjavafrontend)
- Vulnerability Rules for JS 10.3.0.27281 (securityjsfrontend)
- Vulnerability Rules for Python 10.3.0.27281 (securitypythonfrontend)
- PHP Code Quality and Security 3.33.0.11274 (php)
- ABAP Code Quality and Security 3.14.0.5470 (abap)
- Configuration detection for Code Quality and Security 1.3.0.654 (config)
- Vulnerability Rules for PHP 10.3.0.27281 (securityphpfrontend)
Global server settings:
- sonar.core.id=The-ID
- sonar.core.serverBaseURL=https://sonarqube.my.tld
- sonar.core.startTime=2024-02-01T08:21:22+0000
- sonar.dbcleaner.branchesToKeepWhenInactive=master,develop,trunk
- sonar.forceAuthentication=true
- sonar.plugins.risk.consent=ACCEPTED
- sonar.qualityProfiles.allowDisableInheritedRules=false
Project server settings:
Project scanner properties:
- sonar.gradle.skipCompile=true
- sonar.host.url=https://sonarqube.my.tld
- sonar.kotlin.gradleProjectRoot=C:\Dev\Repos\my-project
- sonar.modules=:my-top-level-module-1,:my-top-level-module-2,...,:my-top-level-module-N
- sonar.projectBaseDir=C:\Dev\Repos\my-project
- sonar.projectKey=My_Project_Key
- sonar.projectName=my-project
- sonar.projectVersion=16851-0.SNAPSHOT
- sonar.scanner.app=ScannerGradle
- sonar.scanner.appVersion=4.4.1.3373/Gradle 8.7
- sonar.sourceEncoding=iso-8859-1
- sonar.sources=C:\Dev\Repos\my-project\build.gradle.kts,C:\Dev\Repos\my-project\my-subproject\build.gradle.kts,...
- sonar.verbose=true
- sonar.working.directory=C:\Dev\Repos\my-project\build\sonar
[...]
Scanner properties of module: My_Project_Key:my-top-level-module-1:my-submodule-1
- sonar.binaries=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\classes\java\main,C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\classes\kotlin\main
- sonar.coverage.jacoco.xmlReportPaths=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\reports\jacoco\test\jacocoTestReport.xml
- sonar.jacoco.reportPath=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\jacoco\test.exec
- sonar.jacoco.reportPaths=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\jacoco\test.exec
- sonar.java.binaries=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\classes\java\main,C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\classes\kotlin\main
- sonar.java.enablePreview=false
- sonar.java.jdkHome=C:\Dev\.jdks\temurin-11.0.23
- sonar.java.libraries=C:\Dev\Repos\my-project\my-other-top-level-project\my-other-subproject\build\libs\my-other-top-level-project.my-other-subproject.jar,C:\Dev\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.9.23\dbaadea1f5e68f790d242a91a38355a83ec38747\kotlin-stdlib-1.9.23.jar,...
- sonar.java.source=11
- sonar.java.target=11
- sonar.java.test.binaries=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\classes\java\test,C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\classes\kotlin\test
- sonar.java.test.libraries=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\classes\java\main,C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\classes\kotlin\main,C:\Dev\Repos\my-project\my-other-top-level-project\my-other-subproject\build\libs\my-other-top-level-project.my-other-subproject.jar,C:\Dev\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.9.23\dbaadea1f5e68f790d242a91a38355a83ec38747\kotlin-stdlib-1.9.23.jar,...
- sonar.junit.reportPaths=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\test-results\test
- sonar.junit.reportsPath=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\test-results\test
- sonar.libraries=C:\Dev\Repos\my-project\my-other-top-level-project\my-other-subproject\build\libs\my-other-top-level-project.my-other-subproject.jar,C:\Dev\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.9.23\dbaadea1f5e68f790d242a91a38355a83ec38747\kotlin-stdlib-1.9.23.jar,...
- sonar.moduleKey=My_Project_Key:my-top-level-module-1:my-submodule-1
- sonar.projectBaseDir=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1
- sonar.projectDescription=My Submodule 1 in My Top-level Module 1
- sonar.projectKey=My_Project_Key:my-top-level-module-1:my-submodule-1
- sonar.projectName=my-submodule-1
- sonar.projectVersion=16851-0.SNAPSHOT
- sonar.sourceEncoding=iso-8859-1
- sonar.sources=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\src\main\java,C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\src\main\kotlin
- sonar.surefire.reportsPath=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\build\test-results\test
- sonar.tests=C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\src\test\java,C:\Dev\Repos\my-project\my-top-level-module-1\my-submodule-1\src\test\kotlin
[...]
Scanner properties of module: My_Project_Key:my-top-level-module-2:my-submodule-2:my-sub-submodule
- sonar.binaries=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\classes\kotlin\main
- sonar.coverage.jacoco.xmlReportPaths=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\reports\jacoco\test\jacocoTestReport.xml
- sonar.jacoco.reportPath=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\jacoco\test.exec
- sonar.jacoco.reportPaths=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\jacoco\test.exec
- sonar.java.binaries=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\classes\kotlin\main
- sonar.java.enablePreview=false
- sonar.java.jdkHome=C:\Dev\.jdks\temurin-11.0.23
- sonar.java.libraries=C:\Dev\Repos\my-project\my-other-top-level-project\my-other-subproject\build\libs\my-other-top-level-project.my-other-subproject.jar,C:\Dev\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.9.23\dbaadea1f5e68f790d242a91a38355a83ec38747\kotlin-stdlib-1.9.23.jar,...
- sonar.java.source=11
- sonar.java.target=11
- sonar.java.test.binaries=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\classes\java\test,C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\classes\kotlin\test
- sonar.java.test.libraries=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\classes\kotlin\main,C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\classes\kotlin\testFixtures,C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\libs\my-top-level-module-2.my-submodule-2.my-sub-submodule.jar,C:\Dev\Repos\my-project\my-other-top-level-project\my-other-subproject\build\libs\my-other-top-level-project.my-other-subproject.jar,...,C:\Dev\Repos\my-project\my-other-top-level-project\my-other-subproject\build\classes\kotlin\testFixtures,...
- sonar.junit.reportPaths=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\test-results\test
- sonar.junit.reportsPath=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\test-results\test
- sonar.libraries=C:\Dev\Repos\my-project\my-other-top-level-project\my-other-subproject\build\libs\my-other-top-level-project.my-other-subproject.jar,C:\Dev\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.9.23\dbaadea1f5e68f790d242a91a38355a83ec38747\kotlin-stdlib-1.9.23.jar,...
- sonar.moduleKey=My_Project_Key:my-top-level-module-2:my-submodule-2:my-sub-submodule
- sonar.projectBaseDir=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule
- sonar.projectDescription=My Sub-submodule in My Submodule 2 in My Top-level Module 2
- sonar.projectKey=My_Project_Key:my-top-level-module-2:my-submodule-2:my-sub-submodule
- sonar.projectName=my-sub-submodule
- sonar.projectVersion=16851-0.SNAPSHOT
- sonar.sourceEncoding=iso-8859-1
- sonar.sources=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\src\main\kotlin
- sonar.surefire.reportsPath=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\build\test-results\test
- sonar.tests=C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\src\test\java,C:\Dev\Repos\my-project\my-top-level-module-2\my-submodule-2\my-sub-submodule\src\test\kotlin
[...]
Regarding a reproducer, I can’t see anything unusual about these three tests. There are other tests in similar modules that aren’t resulting in any warnings. As such, I wouldn’t know where to begin to create a minimal project that has a chance of demonstrating the issue.