As you’ve discovered, exclusions are multi-value properties, and rather tricky to get right from the command line / analysis parameter side. I urge you to try setting these values via the UI, so that at least you can eliminate the property-setting syntax as a source of the problem.
Once that’s done, you can focus on the syntax of the exclusions themselves, which look a bit off to me. Under the assumption that you don’t have all your .c and .h files directly in the project root, I’d advise you try **/*.c instead of your current value, and an analogous value for your .h files. Alternately, since you want to exclude these rules for every file (now that I actually read what you’re setting), you could set **/*.* or even better, simply remove the relevant rule from your profile.
My settings are a bit more complicated this was just an example and since I’m not admin off the Quality Gates and Rule the easiest way for me to change the rule is via sonar-project.properties located into a module.
Going back to my previous example
General Rule:
sonar.issue.ignore.multicriteria=e1
sonar.issue.ignore.multicriteria.e1.ruleKey=c:PPDirectiveIndentation
sonar.issue.ignore.multicriteria.e1.resourceKey= **/.
Module Common Rule
common.sonar.issue.ignore.multicriteria=e2
common.sonar.issue.ignore.multicriteria.e2.ruleKey=SomeOtherDirective
common.sonar.issue.ignore.multicriteria.e2.resourceKey=**/.
Rule e1 is applied properly over the root files (but not over the common directory which is what i want)
Rule e2 for the module common is not applied over my common directory files at all
ps: all my modules are recognized and scanned properly
Have you looked at the UI for this? I’m guessing not. If you do, you’ll find that there’s are no inputs to set module-specific issue exclusions (which is what I assume you’re trying to do with common.sonar.issue...). In short, I’m afraid you’re going to have to simply write one regex and be clever with it.
You’re probably about to ask me how to account for the modules in that regex and I’ll pre-empt you with honesty: I simply don’t know. Hopefully, there’s something in the module’s package path you can key off of (and ignore the module question altogether).