Sonar-scanner showed "EXECUTION FAILURE" while Source File Inclusions are set

Hi All:
I use SonarQube recently and the version information below:
SonarQube: Developer Edition Version 9.6.1 (build 59531)
INFO: SonarScanner
INFO: Java Eclipse Adoptium (64-bit)
INFO: Linux 5.3.0-28-generic amd64

Problem description:
We want to scan the source code partially since some parts are not interested.
It is fine to scan the whole source without any change on the project setting.
Then we change the analysis scope and set the “source file inclusions” like “driver/**”
Redo the scanning and the system always show “EXECUTION FAILURE”
More detail can be found in the log.
scan.log (68.7 KB)

Could someone give the advice?


Hey there.

I suspect that you aren’t actually compiling the code under driver/**, therefore it’s not present in your build wrapper output and, with an analysis initiated with build wrapper information and no C/C++ successfully analyzed… the scan fails.

Are you actually compiling the code under driver/** when you wrap your compilation command with the build wrapper?

Hi Colin:
I don’t really understand how to compile the code under driver/** only.
Actually, when we user build wrapper to wrap the compilation command, the scope is whole source code, and this is the only way to compile it.
We have tried to use “source file exclusion” method and it also worked!
So I think there is something wrong in the file inclusion setting.
Do you have other suggestion or what kinds of information I can provide?


Hey there.

My question is – are you actually compiling this code at all?

Hi Colin:
Yes, we can compile the code without any problem.
Just found something interesting:
As long as I redo the scan again and again(usually >5 times), the scan process will be complete and show “EXECUTION SUCCESS”.


In fact, C and C++ analysis uses an analysis cache, so you shouldn’t have to manage this manually if the uninteresting files aren’t changing. I suggest you reset sonar.sources to your entire codebase.

As a side note, inclusions and exclusions should describe filesets, not directories. So something like driver/**/*


Hi Ann:
I think the issue is fixed by reset the sonar.sources to entire codebase
and rescan can be successful.
Thanks for help.


1 Like