Reputation: 20242
I'm trying not to analyse test files with Sonarqube.
I have several Maven subprojects and the test files are under these paths:
subproject1/src/test/
, subproject2/src/test/
and so on
I'm passing the following option from Maven:
-Dsonar.exclusion=src/test/**
However, the test files are still analysed.
I also tried:
-Dsonar.exclusions=**/src/test/**,**/test/*,subproject1/src/test/**,**/*Spec.scala
But issues are still raised on test code.
Upvotes: 1
Views: 7607
Reputation: 22824
There is no property by the name sonar.exclusion
. sonar.exclusions
is a valid property, but it applies to source files. You're trying to exclude test files - and yes the scanners do make the distinction, especially for Maven projects.
You should use instead sonar.test.exclusions
If you want to omit only certain rules, you have two options:
Upvotes: 3