Fairly new to sonar and have a question concerning the sonar.sources and sonar.exclusions in the sonar-project.properties file.
This is for a c++ project and this is the issue I am trying to resolve:
The directory structure is like the following: aLibName/db //which contains .cpp and .h files aLibName/cache // which contains .cpp and .h files and so on with the same structure
When the jenkins we have runs to build it places a /target directory under each of the directories above and copies the .cpp and .h files to it. So I end up with aLibName/db/target //which contains a DUPLICATE of the .cpp and .h files aLibName/cache/target // which contains a DUPLICATE of the .cpp and .h files and so on with the same structure
So what I end up with is a duplicate copy of the .cpp and .h files. Then my sonar scan runs and everything is duplicated with the results, like lines of code, vulnerabilities, …
I am currently getting around it as a test by doing: sonar.sources=mlib/cache,mlib/code sonar.exclusions=mlib/cache/target,mlib/code/target
which is not good… If it was just a couple directories then fine, but I dozens.
So, is there any way to do something like: sonar.sources=mlib sonar.exclusions=“any directory with the name of target”
Thanks for any suggestions.