I'm trying to launch Sonarqube on a .NET Core 2.0 solution from Jenkins using SOnarQube MsBuild on Windows.
It works fine when i execute the following script from Jenkins workspace:
C:\SonarQube\bin\MSBuild.SonarQube.Runner.exe begin /k:XXXX.Campaigns /n:CI /v: /d:sonar.host.url=http://x.x.x.x:9000 /d:sonar.verbose=true /d:sonar.projectBaseDir="C:\Program Files (x86)\Jenkins\workspace\CI"
dotnet clean
dotnet build
C:\SonarQube\bin\MSBuild.SonarQube.Runner.exe end
But when i execute the same command from Jenkins, i got this message:
The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects. Possible causes:
- The project has not been built - the project must be built in between the begin and end steps.
- An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 upwards
- The begin, build or end steps have not all been launched from the same folder
I use Jenkins 2.46.2 - MSBuild 15 - Sonarqube 6.7 & Sonar MsBuild 4.0.2.892. I tried using Jenkins build steps, command step, command step with a script without success. On a classical .Net 4.5.2 project, it works.
Jenkins was running as local system user. I change it to a normal Windows user and it did the trick. dotnet build was not using Sonarqube dedicated targets. Thanks you @Valeri!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With