No analyses found in Gradle build

  • ALM used (Azure DevOps)
  • CI system used (Azure DevOps)
  • Scanner command used when applicable

In azure-pipeline.yml the following two input parameters were used in Gradle@2 build task:

    sonarQubeRunAnalysis: true
    sqGradlePluginVersionChoice: 'build'

Also there is following task present in Gradle build file before the build step:

    - task: SonarCloudPrepare@1
    inputs:
      SonarCloud: '******'
      organization: '******'
      scannerMode: 'Other'
      extraProperties: |
      # Additional properties that will be passed to the scanner, 
      # Put one key=value per line, example:
      # sonar.exclusions=**/*.bin
      sonar.projectKey=******
      sonar.projectName=****** 

And following task after the build step:

    - task: SonarCloudPublish@1
    inputs:
      pollingTimeoutSec: '300'
    env:
      SONAR_TOKEN: $(sonarToken)

And Gradle.properties were updated with:

    systemProp.sonar.host.url=https://sonarcloud.io
  • Languages of the repository: Kotlin, Gradle, Groovy
  • Error observed
    ##[warning]No analyses found in this build! Please check your build configuration.
    Finishing: SonarCloudPublish

Hey there.

Were you able to confirm that the analysis actually did run in your build, without error?

Hello Colin,

The analysis results can be, indeed, found in SonarCloud.io web, however the pull request decoration or Pipeline results page is not being updated with the Sonar Cloud analysis results. Could you please advise or guide me to the document which is fully describing what is necessary? As I believe I have followed the guidance, still the decoration does not work. I am supporting the Sygic organization and both of our projects have this problem. https://sonarcloud.io/organizations/sygic/projects

Thank you very much!

Kind regards,

Martin Rusko

st 5. 10. 2022 o 11:00 Colin via Sonar Community <notifications@sonarcommunity.discoursemail.com> napísal(a):

For reference – the scanner is looking for a report-task.txt file within the Agent build directory, or in the sonar directory for the specific build. The logic can be found here

I would suggest bumping up the Gradle log level --info at least and sharing the logs, redacting any sensitive information.