Hei,
I got stuck setting up the multi language project with teamcity and sonarqube.
-
which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube 7.9.1, TeamCity 2020.2, Scanner 4.2.0 (MSBuild 4.8.0) -
what are you trying to achieve
I have a project, which has at the same time Java and C# code.
Its build up like that:
Modul1 -
cs
** bin
*** Debug -
java
-
target
I now want all information from java and c# in the same SonarQube Project.
- what have you tried so far to achieve this
TeamCity Build Steps
- SonarScanner for MSBuild, begin analysis
- Visual Studio rebuild
- SonarScanner for MSBuild, finish analysis
- Maven build
- SonarQube Runner
Both SonarScanner and SonarQube Runner have the same Projekt Name and Key
My current problem is, that the second language, always overrides the first language.
When I look after the MSBuild fnishes analysis step into SonarQube, I can find the C# code information, etc.
But when SonarQube Runner finishes, all C# code information is removed and only the java information is available.
Also the other way around. If maven build and sonarqube runner first and then sonarscanner msbuild afterwards, the c# code wins
How can I get both?
Thanks
Here the information the teamcity log gives for the starting parameters:
Starting SQS from E:\BuildAgent\tools\sonar-qube-scanner.4.2.0.1873-scanner
-Xmx3g
-classpath
E:\BuildAgent\tools\sonar-qube-scanner.4.2.0.1873-scanner\lib\sonar-scanner-cli-4.2.0.1873.jar
org.sonarsource.scanner.cli.Main
“-Dproject.home=.”
"-Dsonar.host.url=http://sonarqube:9000/
“-Dsonar.jdbc.url=postgresql://localhost/sonarqube”
“-Dsonar.jdbc.username=xxxxx”
“-Dsonar.projectKey=ProjectName”
“-Dsonar.projectName=ProjectName”
“-Dsonar.modules=Modul1”
“-Dsonar.password="
"-Dsonar.login=”
-Dsonar.java.binaries=E:\BuildAgent\work\10ac011372d37747/Modul*/target/classes
“-Dscanner.home=E:\BuildAgent\tools\sonar-qube-scanner.4.2.0.1873-scanner”
“-Dsonar.dynamicAnalysis=reuseReports”
Starting: E:\BuildAgent\tools\sonar-scanner-msbuild.4.8.0.12008\MSBuild.SonarQube.Runner.exe “/d:project.home=.” “/d:sonar.host.url=http://sonarqube:9000/” “/d:sonar.jdbc.url=postgresql://localhost/sonarqube” “/d:sonar.jdbc.username=xxxxxx” “/k:ProjectName” “/n:ProjectName” “/d:sonar.modules=Modul1” “/d:sonar.password=" "/d:sonar.login=” begin
in directory: E:\BuildAgent\work\10ac011372d37747
Starting: E:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:E:\BuildAgent\work\10ac011372d37747 “/msbuildPath:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\bin\MSBuild.exe”
in directory: E:\BuildAgent\work\10ac011372d37747
Starting: E:\BuildAgent\tools\sonar-scanner-msbuild.4.8.0.12008\MSBuild.SonarQube.Runner.exe “/d:sonar.password=" "/d:sonar.login=” end