Must-share information (formatted with Markdown):
- which versions are you using: SQ Gradle plugin 5.0.0.4638, SQ server 9.9.4
- how is SonarQube deployed: I guess via an Azure DevOps task, not sure
- what are you trying to achieve: Have gradle configuration caching enabled
- what have you tried so far to achieve this: Log warnings, disable configuration caching
To me it seems exactly like Sonar Plugin fails when configuration cache is enabled but I was asked to post a new thread .
Part of the Azure DevOps pipeline:
# Prepare SonarQube Analysis
- task: SonarQubePrepare@5
inputs:
SonarQube: "SonarQube" # Name of the service connection
scannerMode: "Other" # Needed for Maven / Gradle integration
extraProperties: |
sonar.projectKey=${{ variables.sonarProjectKey }}
sonar.coverage.jacoco.xmlReportPaths=$(Build.SourcesDirectory)/app/build/reports/jacoco/testBrandB2CEnvIntegrationDebugUnitTestCoverage/brandB2CEnvIntegrationDebug.xml
sonar.coverage.exclusions=**/R.class,**/R$*.class,**/*$ViewInjector*.*,**/*$ViewBinder*.*,**/BuildConfig.*,**/Manifest*.*,**/model/*,**/presentation/customviews/**,**/di/*,**/extensions/*,**/exceptions/*,**/interceptors/*,**/buildSrc/**,**/base/**,**/src/test/**,**/*Fragment*,**/*Dialog*,**/*Activity*,**/*Adapter*,**/*Constants*,**/AppComponent,**/*Dto,**/*Module*,**/*Companion*,**/*DefaultImpls*
sonar.androidLint.reportPaths=$(Build.SourcesDirectory)/app/build/reports/lint-results-brandB2CEnvIntegrationDebug.xml
sonar.exclusions=**/*-noop-sdk/,libaddressinput/**
# projectKey enables PR Decoration
# Other properties configure the test coverage and exclusions
- task: Gradle@3
displayName: 'gradlew envIntegrationDebug'
inputs:
gradleWrapperFile: 'gradlew'
options: '--build-cache -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.http.connectionTimeout=60000 --configuration-cache-problems=warn'
tasks: 'assembleBrandB2CEnvIntegrationDebug testBrandB2CEnvIntegrationDebugUnitTestCoverage'
publishJUnitResults: false
# Sonar Analysis parameters
sonarQubeRunAnalysis: true
sqGradlePluginVersionChoice: "specify"
sonarQubeGradlePluginVersion: "5.0.0.4638" # https://plugins.gradle.org/plugin/org.sonarqube
# Publish SonarQube Quality Gates to Azure DevOps
- task: SonarQubePublish@5
inputs:
pollingTimeoutSec: "300"
Error logs:
/__w/49/s/gradlew --build-cache -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.http.connectionTimeout=60000 --configuration-cache-problems=warn assembleBrandB2CEnvIntegrationDebug testBrandB2CEnvIntegrationDebugUnitTestCoverage -I /__w/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.231.2/node_modules/azure-pipelines-tasks-codeanalysis-common/sonar.gradle sonarqube
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Calculating task graph as no cached configuration is available for tasks: assembleBrandB2CEnvIntegrationDebug testBrandB2CEnvIntegrationDebugUnitTestCoverage sonarqube
1 problem was found storing the configuration cache.
- Task `:sonarqube` of type `org.sonarqube.gradle.SonarTask`: error writing value of type 'org.gradle.api.internal.provider.DefaultMapProperty'
See the complete report at file:///__w/49/s/build/reports/configuration-cache/41v2p3ldrgxfmbf6tzhc7jpin/cgk2d88eitub6i6346x5rspyo/configuration-cache-report.html
FAILURE: Build failed with an exception.
* What went wrong:
Could not load the value of field `properties` of task `:sonarqube` of type `org.sonarqube.gradle.SonarTask`.
> Unexpected provider value
With this, it does get built:
options: '--build-cache -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.http.connectionTimeout=60000 --no-configuration-cache'