Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify wildcards in sonar-project.properties

I am trying to use SonarQube to scan the UI modules I have. The UI modules are lot in number. They have a common structure. Each module has its own JS files.

I need to specify the sonar.sources value to match all JS files in my project. Is it possible to do something like this?

sonar.sources=\*/*/script
sonar.language=js

I used these. But, I got an error saying something like "unable to resolve path". Can someone help?

like image 521
IamSan Avatar asked Jun 19 '15 04:06

IamSan


1 Answers

Try to use wildcard :

*   Match zero or more characters
**  Match zero or more directories
?   Match a single character

Like this:

sonar.sources=**/script

Update

As of 2019, the sonar.sources parameter doesn't support such glob patterns. The common practice is to set this value to a list of directories that contain source code. The scanner will find traverse the directory trees and run applicable analyzers (JavaScript analyzers will consume .js files, Python analyzers will consume .py files, and so on.)

like image 102
Dams Avatar answered Oct 12 '22 11:10

Dams