4

Has anyone managed to get SonarQube working with Upsource? I have downloaded the upsource-sonar-plugin-0.1-SNAPSHOT.jar plugin for SonarQube and set the following in my SonarQube setting file that I add via the /s switch

<Property Name="sonar.upsource.url">url to my upsource</Property>
<Property Name="sonar.upsource.project">my upsouce project id</Property>
<Property Name="sonar.upsource.revision">svn revision number</Property>
<Property Name="sonar.upsource.token">See below</Property>

For the sonar.upsource.token I have tried both the Upsource Build Authentication token and User Permanent Token.

I'm getting no errors when I run the

SonarQube.Scanner.MSBuild.exe end /d:sonar.login="*******"

And get the following in the output

INFO: More about the report processing at http://**********
INFO: Executing post-job Push issues to Upsource

However, I'm not seeing any information in Upsource in regards to what SonarQube has found.

Tanzy
  • 650
  • 5
  • 30
  • Which scanner are you using? – G. Ann - SonarSource Team Apr 11 '18 at 15:58
  • Truth be told, not sure it’s just the default install on Windows. Top of my head its version 6.7. Tried with version 7 and could not get that working so thought it may be a version thing. It’s scanning C# code – Tanzy Apr 11 '18 at 18:01
  • Are you using the [SonarQube Scanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner), the [SonarQube Scanner for MSBuild](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild), the [SonarQube Scanner for Maven](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven), ...? – G. Ann - SonarSource Team Apr 11 '18 at 18:41
  • I’m using the SonarQube scanner for MSBuild. (SonarQube.Scanner.MSBuild.exe) – Tanzy Apr 11 '18 at 19:08
  • And where are you defining those extra properties? Can you try passing them on the command line (`/d:key=value`) instead? – G. Ann - SonarSource Team Apr 11 '18 at 20:05
  • This is the start command I'm issuing, SonarQube.Scanner.MSBuild.exe begin /k:"xxxx" /d:sonar.host.url="http://xxxxxl:9000" /d:sonar.login="eb4393dxxxxxx9b42b506f" /s:"path to sonarqube.xml" I will try from the command line tomorrow, when I'm back in work – Tanzy Apr 11 '18 at 20:09
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/168799/discussion-between-tanzy-and-g-ann-sonarsource-team). – Tanzy Apr 12 '18 at 08:04
  • Still the same, I have ran the following command `SonarQube.Scanner.MSBuild.exe begin /k:"CodeReview" /d:sonar.host.url="http://xxxxxx:9000" /d:sonar.login="xxxxxx" /d:sonar.upsource.url=http://xxxxxx /d:sonar.upsource.project=codereview /d:sonar.upsource.revision=11 /d:sonar.upsource.token=xxxxx` Then the build command `MsBuild.exe /t:Rebuild` Followed by `SonarQube.Scanner.MSBuild.exe end /d:sonar.login="xxxxx"` still nothing showing...... what am I doing wrong :( – Tanzy Apr 12 '18 at 08:06

1 Answers1

2

Ok I have managed to get this to work. You need to add the following to the start

/d:sonar.analysis.mode=issues

setting. Yes, I know this was depreciated in version 6.6 of SonarQube however, it gets it to work. I have tested this against versions 6.5, 6.7 & 7.0 of SonarQube.

Tanzy
  • 650
  • 5
  • 30