Сканер SonarQube для MSBuild: завершилась ошибка интеграции с MSBuild

У меня проблемы с запуском сканера SonarQube. Кажется, что начальная часть работает без проблем, как и команда MSBuild, но конечная часть не работает.

1-й шаг: я выполняю следующую команду сканера SonarQube:

D:\workspace\MasterData>SonarQube.Scanner.MSBuild.exe begin /k:"masterdata" /n:"MasterData" /v:"1.0" /d:sonar.host.url=http: //xyz.com.br:9000/sonarqube /d:sonar.login=5773c2ca935fde42c72494a96de5a68a5b6899d1 /d:sonar.verbose=true

SonarQube Scanner for MSBuild 2.2
Default properties file was found at D:\sonar-scanner-msbuild-2.2.0.24\SonarQube.Analysis.xml

Loading analysis properties from D:\sonar-scanner-msbuild-2.2.0.24\SonarQube.Analysis.xml

sonar.verbose=true was specified - setting the log verbosity to 'Debug'

Pre-processing started.

Preparing working directories...

Using environment variables to determine the download directory...

Removing the existing directory: D:\workspace\MasterData\.sonarqube

Creating directory: D:\workspace\MasterData\.sonarqube

SonarQube server URL: http: //xyz.com.br:9000/sonarqube

SonarQube Scanner for MSBuild 2.2

15:11:10.032  Loading analysis properties from D:\sonar-scanner-msbuild-2.2
.0.24\SonarQube.Analysis.xml

15:11:10.04  sonar.verbose=true was specified - setting the log verbosity to 'Debug'

15:11:10.042  Updating build integration targets...

15:11:10.045  Installed SonarQube.Integration.ImportBefore.targets to C:\Users\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportBefore

15:11:10.046  Installed SonarQube.Integration.ImportBefore.targets to C:\Users\f
g009adm\AppData\Local\Microsoft\MSBuild\12.0\Microsoft.Common.targets\ImportBefore

15:11:10.048  Installed SonarQube.Integration.targets to D:\workspace\MasterData\.sonarqube\bin\targets

15:11:10.049  Creating config and output folders...

15:11:10.049  Creating directory: D:\workspace\MasterData\.sonarqube\conf

15:11:10.049  Creating directory: D:\workspace\MasterData\.sonarqube\out

15:11:10.055  Fetching analysis configuration settings...

15:11:10.062  Fetching properties for project 'masterdata' from http: //xyz.com.br:9000/sonarqube/api/properties?resource=masterdata...

15:11:10.062  Downloading from http: //xyz.com.br:9000/sonarqube/api/properties?resource=masterdata...

15:11:10.214  Downloading from http: //xyz.com.br:9000/sonarqube/api/updatecenter/installed_plugins...

15:11:10.239  Fetching quality profile for project 'masterdata' from http: //xyz.com.br:9000/sonarqube/api/qualityprofiles/search?projectKey=masterdata...

15:11:10.24  Downloading from http: //xyz.com.br:9000/sonarqube/api/qu
alityprofiles/search?projectKey=masterdata...

15:11:10.272  Downloading from http: //xyz.com.br:9000/sonarqube/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=
500&activation=true&qprofile=cs-sbs-cs-default-201410-86215&p=1...

15:11:10.451  Downloading from http: //xyz.com.br:9000/sonarqube/api/rules/search?f=internalKey&ps=500&activation=false&qprofile=cs-sbs-cs-default-201410-86215&p=1&languages=cs...

15:11:10.506  Generating rulesets...

15:11:10.506  Generating the FxCop ruleset: D:\workspace\MasterData\.sonarq
ube\conf\SonarQubeFxCop-cs.ruleset

15:11:10.518  Writing Roslyn generated ruleset to D:\workspace\MasterData\.sonarqube\conf\SonarQubeRoslyn-cs.ruleset...

15:11:10.534  Writing Roslyn analyzer additional file to D:\workspace\MasterData\.sonarqube\conf\cs\SonarLint.xml...

15:11:10.536  Provisioning analyzer assemblies for cs...

15:11:10.538  Installing required Roslyn analyzers...

15:11:10.538  Local analyzer cache: C:\Users\fg009adm\AppData\Local\Temp\7\.sonarqube\.static

15:11:10.538  Processing plugin: csharp version 1.23.0.1828

15:11:10.54  Cache hit: using plugin files from C:\Users\AppData\Local\Temp\7\.sonarqube\.static\csharp_1.23.0.1828\SonarAnalyzer-1.23.0.1828.zip

15:11:10.566  Pre-processing succeeded.

2-й шаг: я выполняю следующую команду MSBuild:

MSBuild.exe /t:Rebuild MasterDataWebServices.sln

Поскольку журнал MSBuild довольно большой, я не буду его здесь приводить. Появляется сообщение «Сборка выполнена успешно» с 5 предупреждениями и 0 ошибками.

3-й шаг: я выполняю следующую команду завершения сканера SonarQube:

D:\workspace\MasterData>SonarQube.Scanner.MSBuild.exe end
SonarQube Scanner for MSBuild 2.2
Default properties file was found at D:\sonar-scanner-msbuild-2.2.0.24\SonarQube.Analysis.xml
Loading analysis properties from D:\sbs1\sonar-scanner-msbuild-2.2.0.24\SonarQube.Analysis.xml

Post-processing started.

SonarQube Scanner for MSBuild 2.2

14:25:22.961  Loading the SonarQube analysis config from D:\workspace\MasterData\.sonarqube\conf\SonarQubeAnalysisConfig.xml

14:25:22.964  Not running under TeamBuild

14:25:22.964  Analysis base directory: D:\workspace\MasterData\.sonarqube

Build directory:
Bin directory: D:\workspace\MasterData\.sonarqube\bin
Config directory: D:\workspace\MasterData\.sonarqube\conf
Output directory: D:\workspace\MasterData\.sonarqube\out

Config file: D:\workspace\MasterData\.sonarqube\conf\SonarQubeAnalysisConfig.xml

Generating SonarQube project properties file to D:\workspace\MasterData\.sonarqube\out\sonar-project.properties

The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:

1. The project has not been built - the project must be built in between the begin and end steps

2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 12.0 upwards are supported

3. The begin, build or end steps have not all been launched from the same folder

Writing processing summary to D:\workspace\MasterData\.sonarqube\out\ProjectInfo.log
Generation of the sonar-properties file failed. Unable to complete SonarQube ana
lysis.

14:25:22.988  Creating a summary markdown file...

14:25:22.989  Post-processing failed. Exit code: 1

person mauricio_casal    schedule 24.03.2017    source источник
comment
Похоже, вы выполнили начальный шаг в D:\workspace\MasterData и конечный шаг в `D:`. Вы должны выполнить все шаги в одном рабочем каталоге.   -  person janos    schedule 25.03.2017
comment
Спасибо за комментарий. Я снова выполнил те же команды, позаботившись о пути, все выполнялись внутри D: \ workspace \ MasterData, к сожалению, возникла та же проблема.   -  person mauricio_casal    schedule 27.03.2017
comment
Я также пытался запустить эти команды с другим проектом C #, возникла та же проблема.   -  person mauricio_casal    schedule 27.03.2017


Ответы (1)


Я столкнулся с той же проблемой. В моем случае я установил соответствующую версию MSBuild, необходимую для моей версии Sonar, и она работала нормально.

Моему SonarScanner требовалась версия 14.0 или более поздняя версия MSBuild, тогда я скачал Microsoft Инструменты сборки 2015.

В вашем случае я считаю, что эта версия тоже будет работать, а если нет, вы можете попробовать конкретнее эту версию.

Надеюсь, поможет.

person Flávio Tavares    schedule 08.11.2017