Directory excluding in sonar-project.properties file doesn't work (for me)

29,000

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).

Share:
29,000

Related videos on Youtube

Fatemeh Rostami
Author by

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, 2022

Comments

  • Fatemeh Rostami
    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
    SanthoshM almost 7 years
    thanks for the comma separation information. It saved me a day.
  • GreenTurtle
    GreenTurtle over 6 years
    This 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
    Cole over 6 years
    ok I just wanna throw out that it's really confusing sonar.sources uses path relative to sonar-project.properties, and apparently sonar.exclusions doesn't? ugh took me forever. thanks, never would have tried that
  • Inego
    Inego over 2 years
    The provided links are currently broken.