sonar.coverage.exclusions doesn’t exclude files from analysis. It excludes them from coverage calculations. I recommend you set exclusions via the UI. One benefit of that is that there are section headings and brief description of each property there.
You’re looking for sonar.exclusions, under the Files section.
Because I am trying to do it on gitlab ci yaml so I am not able to set it on UI side I need a flag like ‘Dsonar.exclusions`Something like that so that when I use sonar scanner command like it exclude the file