Sonarcloud doesn't pick the .sonarcloud.properties

We have a project for Android using Gradle. The thing is that is too big and we would go over the limit plan we currently have, so we want Sonarcloud to only pick one of the main folders. We have look in the UI, and we saw that we could use exclusions to take some folders out, but looking in the documentation, we saw that using sonar.sources we could determine one folder. So, I create in the root level of the project a the file .sonarcloud.properties and paste the next block:

# Path to sources
#sonar.sources=experiences/
#sonar.exclusions=
#sonar.inclusions=

# Path to tests
#sonar.tests=
#sonar.test.exclusions=
#sonar.test.inclusions=

# Source encoding
#sonar.sourceEncoding=UTF-8

# Exclusions for copy-paste detection
#sonar.cpd.exclusions=

But the automatic analysis doesn’t pick it. When I check the params of the last background task that made the analysis, I have this sonar.sources=..

I have tried commenting the line, uncommenting, with and without ** after the \ and nothing, in the four executions the param value is the same, the dot.

Hey there.

As noted in the docs

Java automatic analysis does not support the following properties:

  • sonar.sources
  • sonar.tests
  • sonar.inclusions
  • sonar.test.inclusions

So I suggest you either use sonar.exclusions, or switch to CI-based analysis where you can more tightly control the analysis scope.

Okay, thanks. I read Java and I thought it didn’t affect us, as it it with Kotling, didn’t realize Gradle.

Hm… I wonder if we could do a better job in the docs describing what we detect (I’m pretty sure when we detect a Gradle file, we automatically select the “java” flavor of Automatic Analysis). Let me follow up on that.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.