I know that you can add files/folders from code coverage exclusions, by sending this sonar.coverage.exclusions to the analyzer.
However if you have some exclusions on the project settings, this settings seems to override the project settings, and not doing a union of the exclusion provided by project settings/commandline
is it somehow possible to reference the existing exclusions on project level in the commandline and append to them. something in the lines of
Welcome to the SonarSource community. . Hope you’ll enjoy it
What you’re asking is not possible and it does not seem very useful to implement.
You should decide on your policy: Either you set your exclusions on the server side, or on the client side, but not on both. If you set both, the client (scanner) side, supercedes the server side, as you noticed.
And normally I would say that it’s better to set the exclusions on the scanner side. These parameter are typically stored in the repository (either in sonar-project.properties or in the pipeline description file (JenkinsFile, YAML, you name it)). This is the best place to be to keep the exclusions in good sync with the code.