What is the alternative to the sonar.language property in the current version of sonarqube?

scanner
sonarqube

(Eliezer Ramm) #1

Hi

What is the alternative to the sonar.language property in the current version of sonarqube ? Sometime I would like to only scan a specific language. The old way was sonar.language=c and that made sure that the Cfamily plugin was used.

SQ - 6.7.2.37468


(G Ann Campbell) #2

Hi,

The alternative is to just not use it. :slightly_smiling_face:

Seriously, if C, C++ or Objective-C files are found in the project, SonarCFamily will automatically be used and no further action on your part is required.

Now if, on the other hand, you want to prevent other languages in the project from being analyzed, then you should do one of these things:

  • configure sonar.sources not to include those files, assuming this can be done conveniently
  • set exclusions
  • as a last-ditch hack, there’s also the option of configuring language file suffixes at the project level to not recognize the other languages’ files (e.g. set the Java file suffix to .foo)

 
Ann


(Eliezer Ramm) #5

so in my case the exclusions property looks like this

sonar.exclusions=**/*.java,**/*.jar


(Dinesh Bolkensteyn) #6

Which seem very related to your other topic. Please only open a single topic per issue going further. Thank you.