The setting doesn’t seem to have any effect. SonarScanner still complaining about the files under excluded directory.
However, if we exclude the same pattern at project level in sonar-project.properties then the warnings disappear as expected. We would like to exclude the pattern globally for every project.
Next is to check what files are getting indexed. That is shown with debug logs enabled.
Finally, the number of excluded files is logged as well in INFO:
[INFO] 15:15:26.057 9 files ignored because of inclusion/exclusion patterns
When defining it in the sonar-project.properties, what property key did you use?
I just did a quick test and files excluded with the global property defined on the server aren’t getting blamed.
Hi @ragnarpa ,
Since you got it working I thought the topic was “closed”.
Looking at the logs when you have the global exclusions set, it looks like sonar.global.exclusions is being overwritten with a different value. Maybe this is being done in the scanner side, in the sonar-project.properties or in the build systems configuration? Properties don’t get merged if they are defined multiple times in different places.
Hey. There is clearly something broken. The SonarQube UI says following
“They apply to every project and cannot be overridden.”
So my expectation is that sonar.global.exclusions get merged with project local settings which apparently isn’t the case although the UI says that global settings can’t be overwritten.
Is there another channel where I can report this problem? We are a paying customer.
Perhaps the wording in the UI is too strong. Global exclusions are not overridden by sonar.exclusions. Probably your sonar.global.exclusions value was overridden by a value set for that same key at another level..
That’s what I meant - sonar.global.exclusions is probably being overridden elsewhere by the same property defined on the scanner side. The solution is to change the scanner configuration and use sonar.exclusions instead.
I created a ticket to either fix the behavior or clarify the documentation and labels: [SONAR-17305] - Jira