SonarQube.Runner is incompatible with C # plugin

I am trying to get the following Sonar C # plugin by following the instructions here: http://docs.sonarqube.org/display/PLUG/C%23+Plugin

The C # plugin installed on the server is incompatible with MSBuild.SonarQu be.Runner.exe - either check the compatibility matrix or get the latest versions for both. Failed to perform preprocessing. Exit Code: 1 "

in step 6) a:

MSBuild.SonarQube.Runner.exe begin /k:"sonarqube_project_key" 
/n:"sonarqube_project_name" /v:"sonarqube_project_version"
  • I tried SonarQube versions 4.5.4 (LTS) and 5.1.1
  • Developer Command Line for VS2012
  • I installed java (oracle): jdk-8u51-windows-x64.exe
  • Microsoft (R) Build Engine version 4.0.30319.34209
  • Runs on a Windows 2012 server

Any ideas on how to fix this?

thank


From MrFox:

I have added generosity to this question and am adding my questions on this issue here:

  • SonarQube "SonarQube_project_key" , , SonarQube .
  • "" , , . , .
  • "sonarqube_project_version"? 6.5 ( SonarQube), 6.4.1 ( SonarQube#), 1.0.1 ( MSBuild.SonarQube.Runner.exe)

, - #:

MSBuild.SonarQube.Runner.exe begin/k: "org.sonarqube:sonarqube-scanner-msbuild" /n: "Kadaster.Agris" /v: "1.0.1"

.
Analysis Bootstrapper Visual Studio, , .

: . Error Screenshot , , :

> D:\projects\agris\src>MSBuild.SonarQube.Runner.exe begin
> /k:"org.sonarqube:Kadas ter_Agris" /n:"Kadaster_Agris" /v:"0.1"
> Default properties file was found at
> D:\Software\MSBuild.SonarQube.Runner.1.0.1\ SonarQube.Analysis.xml
> Loading analysis properties from
> D:\Software\MSBuild.SonarQube.Runner.1.0.1\Sona rQube.Analysis.xml
> Pre-processing started. Preparing working directories... Checking for
> updates... The C# plugin installed on the SonarQube server is not
> compatible with the Sonar Qube analysis agent (i.e. the
> MSBuild.SonarQube.Runner.exe, or the build automat ion task). Either
> check the compatibility matrix or get the latest versions for both.
> Pre-processing failed. Exit code: 1

The first step is to do pre-processing:

> D:\projects\agris\src>D:\Software\sonar-scanner-msbuild-3.0.2.656\MSBuild.SonarQ
> ube.Runner.exe begin /k:"myCompanyHostedSonarQube:GMA_Kadaster_Agris"
> /n:"Kadas ter_Agris" /v:"0.1" SonarQube Scanner for MSBuild 3.0.2
> Default properties file was found at
> D:\Software\sonar-scanner-msbuild-3.0.2.656 \SonarQube.Analysis.xml
> Loading analysis properties from
> D:\Software\sonar-scanner-msbuild-3.0.2.656\Son arQube.Analysis.xml
> Pre-processing started. Preparing working directories... 09:08:16.861 
> Updating build integration targets... 09:08:16.879  Fetching analysis
> configuration settings... 09:08:17.971  Generating rulesets...
> 09:08:17.993  Provisioning analyzer assemblies for cs... 09:08:17.994 
> Installing required Roslyn analyzers... 09:08:18.507  Pre-processing
> succeeded.

.
SonarQube , :

> Done Building Project "D:\projects\agris\src\Kadaster.Agris.sln"
> (Rebuild targe t(s)).
> 
> 
> Build succeeded.
> 
> "D:\projects\agris\src\Kadaster.Agris.sln" (Rebuild target) (1) ->
> "D:\projects\agris\src\Kadaster.Agris.Web\Kadaster.Agris.Web.csproj.metaproj"
> ( Rebuild target) (13) ->
> "D:\projects\agris\src\Kadaster.Agris.Web\Kadaster.Agris.Web.csproj"
> (Rebuild t arget) (14) -> (CoreCompile target) ->  
> Controllers\OutputController.cs(48,30): warning CS0168: The variable
> 'ex' is declared but never used
> [D:\projects\agris\src\Kadaster.Agris.Web\Kadaster.Agri s.Web.csproj] 
> Controllers\OutputController.cs(80,30): warning CS0168: The variable
> 'ex' is declared but never used
> [D:\projects\agris\src\Kadaster.Agris.Web\Kadaster.Agri s.Web.csproj] 
> Controllers\OutputController.cs(166,30): warning CS0168: The variable
> 'ex' is  declared but never used
> [D:\projects\agris\src\Kadaster.Agris.Web\Kadaster.Agr is.Web.csproj]
> 
>     3 Warning(s)
>     0 Error(s)
> 
> Time Elapsed 00:00:08.91
> 
> D:\projects\agris\src>D:\Software\sonar-scanner-msbuild-3.0.2.656\MSBuild.SonarQ
> ube.Runner.exe end SonarQube Scanner for MSBuild 3.0.2 Default
> properties file was found at
> D:\Software\sonar-scanner-msbuild-3.0.2.656 \SonarQube.Analysis.xml
> Loading analysis properties from
> D:\Software\sonar-scanner-msbuild-3.0.2.656\Son arQube.Analysis.xml
> Post-processing started. The SonarQube MSBuild integration failed:
> SonarQube was unable to collect the re quired information about your
> projects. Possible causes:
>   1. The project has not been built - the project must be built in between the b egin and end steps
>   2. An unsupported version of MSBuild has been used to build the project. Curre ntly MSBuild 14.0 upwards are supported
>   3. The begin, build or end steps have not all been launched from the same fold er Generation of the sonar-properties file failed. Unable to
> complete SonarQube ana lysis. 14:38:26.197  Creating a summary
> markdown file... 14:38:26.2  Post-processing failed. Exit code: 1

.

+4
1

SonarQube "SonarQube_project_key" , , SonarQube .

, /k:, SonarQube. , . , - Visual Studio.

/n: SonarQube.

/v: , . SonarQube , . reset . SonarQube , .

, "" , , . , .

"" SonarQube SonarQube. Visual Studio "". SonarQube Visual Studio. , . Visual Studio SonarQube.

Analysis Bootstrapper Visual Studio, , .

. , .


, Scanner MSBuild. , :

https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild

, MSBuild MSBuild 14 . , Visual Studio 2015 . , .

+2

Source: https://habr.com/ru/post/1599528/


All Articles