SonarQube MSBuild集成失败:SonarQube无法收集有关您的项目的必要信息

js.*_*. c 7 msbuild sonarqube

我这样安装......

sonarqube-6.2 | 声纳扫描仪-2.8 | sonar-scanner-msbuild-2.2.0.24 | msbuild 14

我制作了Windows批处理文件来构建和扫描(声纳).但有些项目还可以.但有些项目失败了.

批处理文件是......

MSBuild.SonarQube.Runner.exe begin/k:%PROJECT_KEY%/ n:%PROJECT_NAME%/ v:%BUILD_VERSION%/ d:sonar.verbose = true

MSBuild.exe"projects"/ t:build/v:m

MSBuild.SonarQube.Runner.exe结束

错误信息是......

用于MSBuild 2.2的SonarQube扫描程序在C:\ SONARQUBE\sonar-scanner-msbuild-2.2.0.24\SonarQube.Analysis.xml中找到默认属性文件从C:\ SONARQUBE\sonar-scanner-msbuild-2.2.0.24加载分析属性\ SonarQube.Analysis.xml后期处理已开始.用于MSBuild 2.2的SonarQube扫描仪18:50:20.591从C:\ jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\conf\SonarQubeAnalysisConfig.xml 18:50:20.592加载SonarQube分析配置不在TeamBuild 18:50:20.593下运行分析基目录: C:\ jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube构建目录:Bin目录:C:\ jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\bin配置目录:C:\ jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\conf输出目录:C:\ jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\out配置文件:C:\ jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\conf\SonarQubeAnalysisConfig.xml将SonarQube项目属性文件生成到C:\ jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\out\sonar-project.属性SonarQube MSBuild集成失败:SonarQube无法收集有关项目的必需信息.

可能的原因:

  1. 项目尚未建成 - 项目必须建立在开始和结束步骤之间

  2. 已使用不受支持的MSBuild版本来构建项目.目前支持MSBuild 12.0以上版本

  3. 开始,构建或结束步骤尚未从同一文件夹启动

将处理摘要写入C:\ jenkins_slave_buildpc\workspace\amis3_client_sonar.sonarqube\out\ProjectInfo.log生成声纳属性文件失败.无法完成SonarQube分析.18:50:20.615创建摘要降价文件... 18:50:20.617后处理失败.退出代码:1

我为声纳执行了相同的批处理文件.但有些项目还可以.并且某些项目失败了.是什么原因导致此错误消息?

Ani*_*nil 4

尝试MSBuild.SonarQube.Runner end在 teamcity 中运行命令时,我遇到了类似的错误。构建项目的开始步骤和 MSBuild 步骤工作正常。

当我在 teamcity 中给出 runner 和 MSbuild 的完整路径时。这对我有用。

C:\SonarQube\sonar-scanner-msbuild-3.0.2.656\MSBuild.Sonarqube.runner.exe 
begin /k:"Sonar key here" /n:"Sonar project here" /v:%build.number% 
/d:sonar.log.level=DEBUG 

"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" [path for .sln file 
here] /t:Rebuild 
/p:VisualStudioversion=14.0;Configuration=Release;Platform="Any CPU"

C:\SonarQube\sonar-scanner-msbuild-3.0.2.656\MSBuild.Sonarqube.runner end
Run Code Online (Sandbox Code Playgroud)