I am scanning code using sonar:sonar maven goal.
I have to exclude certain files from sonar scannig. I can do this using property sonar.exclusions. (e.g. sonar.exclusions=/my-pkg//*)
Now my questions are how can I pass property to sonar:sonar?
I have following options
a) use of -Dsonar.exclusions=/my-pkg//* while calling sonar:sonar
b) use of <sonar.exclusions>/my-pkg//</sonar.exclusions> in pom.xml
c) use of sonar-project.properties and specify sonar.exclusions=/my-pkg// in it.
I know a) and b) above works. But I am keen to use option c) as it keeps sonar config consolidated and isolated in separate file and dont clutter my pom.xml.
Reading from documentation at https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven I am not sure whether options c) works?
(I did tried it but has not worked for me - I am not sure if its my mistake or sonar:sonar does not support it?)
Thus my real question to community is does sonar-project.properties present in project folder work with maven sonar:sonar goal???
Appreciate any help on this.
Many Thanks !