42

I am setting up Sonar for one of my projects which is a mix of Groovy and Java. I am able to configure the project separately for either of these languages but not together. Is there any way to do this? I tried this

sonar.language = java,grvy

but didnt work

3 Answers 3

51

UPDATE April 14th, 2014:

Starting with SonarQube 4.2, multi-language projects are supported.

This automatically happens when sonar.language is not set.

See my sample project here: https://github.com/bellingard/multi-language-project

8
  • 1
    @Fabrice-SonarTeam, can we do the same with maven? And if yes, do you have any examples? Thanks! p.s. that example on the git hub doesn't actually help, because we have different languages in one source folder.
    – mr.nothing
    Mar 14, 2013 at 10:36
  • 1
    @mr.nothing You can probably check Neeraj's answer below as well
    – rajesh
    Mar 18, 2013 at 14:15
  • @Fabrice-SonarTeam We have a solutions containing projects containing a mix of Javascript, C# and Xsd files. Looking at the .NET example: github.com/SonarSource/sonar-examples/tree/master/projects/… I don't see how you descripbe to Sonar which languages to analyse? It just seems to has 'cs' in the sonar-project.properties file.
    – RoboJ1M
    May 9, 2013 at 16:46
  • @Fabrice-SonarTeam I think I must be missing something, why did you add to your answer that Sonar 3.3 and runner 2.0 can analyse multi-language projects?
    – RoboJ1M
    May 13, 2013 at 8:22
  • 1
    @Fabrice-SonarSourceTeam the link github.com/SonarSource/sonar-examples/tree/master/projects/… has broken. I am trying to configure C# and JavaScript, but it works only for C# and overrides C# test counts when I set sonar.tests='js-tests-dir'. I cant see both counts in dashboard Aug 31, 2018 at 8:57
2

If you are using Sonar version 3.4. Then I have written a new maven plugin to help you with multiple language code analysis.

It is still beta

https://code.google.com/p/sonar-multilang-maven-plugin/wiki/UserGuide

If you have any issues with this tool then do let me know on that project website.

0

Until https://jira.sonarsource.com/browse/SONAR-926 is implemented you can use the combination of sonar.branch and sonar.language properties to analyze separately the project languages and have two different projects in your dashboard.

1
  • 2
    Can you please elaborate on the use of sonar.branch? My project is a mix of java and groovy mixed together. I mean there is no separation of src folders
    – rajesh
    Nov 30, 2012 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.