5

Sonar scanner runs analysis for all the available plugins installed in SonarQube. But for some of the projects analysis should be run only for some languages(For example Java and Javascript). sonar.language parameter allows me to set only one language. Is there any way to set multiple languages for analysis.

Manoj Kumar
  • 289
  • 4
  • 12

2 Answers2

5

Stop thinking in term of language, since this is a blur concept in SonarQube. Just exclude the files you don't want to analyze, using for example the property sonar.exclusions.

For example, when considering a pom.xml file, the "language" was historically XML (and rules provided by SonarXML). But we now also have rules provided by SonarJava.

3

The property sonar.language was deprecated in SonarQube 4.4 and might be removed in SonarQube 6.7 or later, because SonarQube can now use several languages (which seems to be exactly the issue that you face currently).

If you only want Java and Javascript issues to be reported, I suggest to create custom quality profiles for all other languages, containing 0 rules. You can then, for your project, explicitly assign those "void" quality profiles.

slartidan
  • 20,403
  • 15
  • 83
  • 131
  • This may be a workaround. But still the other language plugins runs analysis for duplication, coverage and other metrics. My requirement is to completely ignore scanning for the remaining languages – Manoj Kumar Oct 11 '17 at 11:50
  • 1
    You could use [exclusions](https://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-IgnoreDuplications) to ignore duplication, coverage and other metrics for files that match a pattern. – janos Oct 11 '17 at 12:31