After some googling, I have found the below solution and it worked perfectly fine for me.
Steps:
- Replace the
sonar-project.properties
to.sonarcloud.properties
- Added the same set of configuration that I had used in the
sonar-project.properties
file. - Perform the scan analysis through “Sonarcloud”.
Result: It has excluded all the file/folder that I had mentioned in the .sonarcloud.properties
file.
Learning: It seems Sonarcloud
looks for .sonarcloud.properties
file instead of the sonar-project.properties
file. I am sure this might have captured in the documentation but unfortunately whatever I have read so far couldn’t see this step.
A clue that triggers to above solution was from this source: SonarCloud sonar.exclusions not working still/again
Happy Learning!