Home:ALL Converter>Using Jenkins SonarQube MSBuild plugin with dotnet core on linux

Using Jenkins SonarQube MSBuild plugin with dotnet core on linux

Ask Time:2019-02-28T19:39:57         Author:duoarc

Json Formatter

i am struggling to both understand and get the Jenkins SonarQube MSBuild to analyse a dotnet core c# project and hoped someone could help out with it. I am able to run the scan using the following commands in an "Execute Shell" build step:

dotnet sonarscanner begin /k:"xxx" /n:"xxx" /v:"xxx" dotnet build xx.sln --configuration Release dotnet sonarscanner end

my current setup is:

Jenkins Server running on Amazon linux, on which i have installed jenkins (version 2.150.2) dotnet core and the sonarqube msbuild plugin

[jenkins@jenkins_qa sonar]# dotnet --info .NET Core SDK (reflecting any global.json): Version: 2.2.104 Commit: 73f036d4ac

Runtime Environment: OS Name: amzn OS Version: 2 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/2.2.104/

Host (useful for support): Version: 2.2.2 Commit: a4fd7b2c84

.NET Core SDKs installed: 2.1.4 [/usr/share/dotnet/sdk] 2.2.104 [/usr/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

sonarqube server is installed on an Amazon Windows Instance.

I would like to use the plugin to run the analysis as this will include the report on the jenkins ui.

Thanks in advance

Author:duoarc,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/54924885/using-jenkins-sonarqube-msbuild-plugin-with-dotnet-core-on-linux
yy