Sonarscanner not accepting Wildcard Patterns

Hi, while working with code coverage wildcard patterns are not getting excluded. This is an intermittent issue as when we reset the wildcards and do it again it accepts the exclusions.
SonarQube scanner integrated with CI pipeline is sometimes not considering the pre-configured coverage and source exclusion wild card patterns.
Its Sonarqube community edition.

Please suggest.


Welcome to the community!

You haven’t provided a lot of detail here so it’s down to guessing at this point. That said, you mentioned that sometimes it works and sometimes it doesn’t. That suggests to me that the content of your edits may be the problem. If you’re sure about your syntax, you might also double-check trailing whitespace.


Please see the logs below

2020-06-26T20:43:33.4480508Z [INFO] Source paths: pom.xml

2020-06-26T20:43:33.4481037Z [INFO] Source encoding: UTF-8, default locale: en_US

2020-06-26T20:43:33.5615240Z [INFO] Index files

2020-06-26T20:43:33.5663871Z [INFO] Excluded sources:

2020-06-26T20:43:33.5664719Z [INFO]   **/WebContent/parts-management/bower_components/**

2020-06-26T20:43:33.5665314Z [INFO]   **/WebContent/parts-management/fonts/**

2020-06-26T20:43:33.5665816Z [INFO]   **/WebContent/parts-management/images/**

2020-06-26T20:43:33.5666380Z [INFO]   **/WebContent/parts-management/qcm-beta/bower_components/**

2020-06-26T20:43:33.5666913Z [INFO]   **/WebContent/parts-management/qcm-beta/fonts/**

2020-06-26T20:43:33.5667707Z [INFO]   **/WebContent/parts-management/qcm-beta/images/**

2020-06-26T20:43:33.5669531Z [INFO]   **/node_modules/**

2020-06-26T20:43:33.5670064Z [INFO]   **/VSIM_MASP_TRUNK/**

2020-06-26T20:43:33.5670577Z [INFO]   **/WebContent/parts-management/elements/elements.vulcanized.html

2020-06-26T20:43:33.5671155Z [INFO]   **/WebContent/parts-management/data/**

2020-06-26T20:43:33.5671636Z [INFO]   **/VSIM_MASP_TRUNK/**

2020-06-26T20:43:33.5672154Z [INFO]   **/QCM_TPD_BRANCH/qcm-data-access-ejb/src/test/**

2020-06-26T20:43:33.5672718Z [INFO]   **/QCM_TPD_BRANCH/qcm-domain-ejb/src/test/**

2020-06-26T20:43:33.5673232Z [INFO]   **/QCM_TPD_BRANCH/qcm-rest-common/src/test/**

2020-06-26T20:43:33.5673955Z [INFO]   **/QCM_TPD_BRANCH/qcm-restful-services/src/test/**

2020-06-26T20:43:33.5677792Z [INFO]   **/QCM_TPD_BRANCH/qcm-vsim-shared/src/test/**

2020-06-26T20:43:33.5810622Z [INFO] 1 file indexed

2020-06-26T20:43:33.5830492Z [INFO] Quality profile for xml: Sonar way

Sonar analysis which ran today is not including the exclusion wild card patterns

2020-06-29T04:18:15.1844893Z [INFO] Source paths: pom.xml

2020-06-29T04:18:15.1845728Z [INFO] Source encoding: UTF-8, default locale: en_US

2020-06-29T04:18:15.2950313Z [INFO] Index files

/****         Exclusion Wild Card Patterns Not Included Here ****/

2020-06-29T04:18:15.3131650Z [INFO] 1 file indexed

2020-06-29T04:18:15.3148662Z [INFO] Quality profile for xml: Sonar way

Can anyone please help on this


Not sure what else there is to say. You say there’s an intermittent problem. For me that points to something outside SonarQube. You need to isolate the circumstances under which it stops working and the circumstances under which it resumes working.


The only way i can explain is, when wildcard exclusion doesnt happen, we try to remove one and save and run it again and then it accepts. But this is the issue that we cant keep on doing it every time whenever the wildcard patterns are missed.