Does Sonar support multiple language in same project?

38,941

Solution 1

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

Solution 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.

Share:
38,941
rajesh
Author by

rajesh

Updated on July 09, 2022

Comments

  • rajesh
    rajesh almost 2 years

    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

  • rajesh
    rajesh over 11 years
    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
  • mr.nothing
    mr.nothing about 11 years
    @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.
  • rajesh
    rajesh about 11 years
    @mr.nothing You can probably check Neeraj's answer below as well
  • RoboJ1M
    RoboJ1M almost 11 years
    @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
    RoboJ1M almost 11 years
    @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?
  • AKS
    AKS over 9 years
    Does it work for a project with both Groovy (grvy) and Java source/test code or mixed? I don't think it's working (sonar.language=grvy,java)
  • AKS
    AKS about 9 years
    @Fabrice-SonarQubeTeam I tried it and got this. Can you please comment on that, thanks Fabrice. stackoverflow.com/questions/28154607/…
  • xbmono
    xbmono over 7 years
    We are using v5.5 but it still doesn't pick the js files located in 'resources' folder. I looked at the example, there is no special configuration.. have I missed anything?
  • Murali Murugesan
    Murali Murugesan over 5 years
    @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