27

I look through the Internet and tried a million diferent ways, but didn't find an answer.

Is there any way to exclude some folders with source files from the Sonar analysis, when I use maven to launch it (e.g. mvn sonar:sonar)?

Luís Cruz
  • 14,780
  • 16
  • 68
  • 100
mr.nothing
  • 5,141
  • 10
  • 53
  • 77

1 Answers1

33

You can use the "sonar.exclusions" property to exclude source files using patterns: see http://docs.sonarqube.org/display/SONAR/Analysis+Parameters

  • 4
    thank you one more time! I just figured it out. I used "folder", instead of "folder/**" to exclude folder, subfolder and files and it, obviously, had no effect. – mr.nothing Feb 25 '13 at 12:48
  • +1 This is obviously the correct answer - I will delete mine (although I got some reputation points ;-)) – FrVaBe Feb 25 '13 at 12:53
  • 2
    Just to point out that if you want to specify several exclusions, separate them with commas. – Alfergon Apr 05 '14 at 17:51
  • Folks, if I add **/folder/** shall I expect that *all* sub-folders from the folder will be ignored too? – rafa.ferreira Sep 06 '16 at 20:42