Unable to ignore multiple directories

Hi, I’m using sonar-scanner- In the top directory of my project source, I have a sonar-project.properties file in which I would like to specify multiple directories to be excluded from scanning (as I have some root-owned directories in the repo, some 3rd party code and so on). To give some context, here is my directory structure:
my-project ----> Project Dir
my-project/sonar-project.properties —> Properties file
my-project/A/B/C/D/** ----> Want to ignore anything and everything under the directory D

I’ve tried the below patterns in sonar.exclusions but none seem to work as the scanner always ends up trying to scan the contents under D and errors out as they are root owned.


None of the above work. Please suggest which would be a right pattern?

Hi @Harshvardhan_Patel,

Welcome to the Community! :smiley:

It’s difficult to tell without the logs, but I’m guessing that the scanner is erroring because there are some files in D itself (not subdirectories of D) owned by root. To exclude all files in D as well as all files in subdirectories of D you can use


Can you give that a try and see if it solves the issue? If not, feel free to post relevant snippets of the scanner log file.



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