Directory excluding in sonar-project.properties file doesn't work (for me)
Solution 1
I realized that first I should have written directory name Like below to exclude all folders and file on that directory:
sonar.exclusions=utility/Excel/**/*
Second I should have used comma separated directory names to exclude more than one directory:
sonar.exclusions=utility/Excel/**/* , utility/mailer/**/*
Solution 2
Look at the Inclusions/Exclusions Patterns documentation , and try this: sonar.exclusions=utility/Excel/**
.
Note: pointing sonar.sources to the current directory is usually a mistake, you should point it to the actual directories which contain the sources (more details in Analysis Parameters).
Related videos on Youtube
Fatemeh Rostami
Experienced PHP Developer with more than 11 years of experience building various types of web applications using different PHP Frameworks.
Updated on July 18, 2022Comments
-
Fatemeh Rostami almost 2 years
I have excluded the directory in my project properties but sonar doesn't exclude it. Can anyone help me to find problem?
sonar.sources=./ sonar.exclusions=./utility/Excel/**
-
SanthoshM almost 7 yearsthanks for the comma separation information. It saved me a day.
-
GreenTurtle over 6 yearsThis should be the accepted answer, not your own post answered 5 days later and explained stuff which wasn't even part of the question.
-
Cole over 6 yearsok I just wanna throw out that it's really confusing
sonar.sources
uses path relative to sonar-project.properties, and apparentlysonar.exclusions
doesn't? ugh took me forever. thanks, never would have tried that -
Inego over 2 yearsThe provided links are currently broken.