Properties file exclude multiple paths

Jon Duffy picture Jon Duffy · Jun 10, 2015 · Viewed 11.3k times · Source

I have a sonar-project.properties file, which specifies how sonar-runner inspects the the folder structure, which files to inspect, which files to ignore etc.

I cannot successfully determine however how to exclude multiple paths successfully.

Here is the sonar-project.properties file:

sonar.projectKey=C3S-web
sonar.projectName=C3S-sonar-web
sonar.projectVersion=0.0.1

sonar.sources=.
sonar.tests=test
sonar.language=js
sonar.profile=Sonar way
sonar.exclusions=test/*, node_modules/*
sonar.dynamicAnalysis=reuseReports

sonar.javascript.jstest.reportsPath=coverage
sonar.javascript.lcov.reportPath=coverage/lcov-report

the line I am having trouble with is:

sonar.exclusions

listing multiple paths does not work, with or without a comma, or in quotes either.

Answer

Pedro Penna picture Pedro Penna · Aug 17, 2016

You have to use the double asterisk pattern to recursively exclude all sub-folders and files:

sonar.exclusions=test/**, node_modules/**

A single asterisk matches only the files on that specific folder (no recursion).