首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行SonarQube时出错-没有找到ProjectInfo.xml文件

运行SonarQube时出错-没有找到ProjectInfo.xml文件
EN

Stack Overflow用户
提问于 2016-02-17 06:13:28
回答 2查看 4.3K关注 0票数 1

我正在使用SonarQube 5.2来计算度量。当我使用"Developer Command Prompt for VS2013“运行它时,一切都很好。

但是,当我使用普通命令提示符"cmd.exe“运行相同的命令时,无论是否具有管理员权限,我都会得到以下错误

代码语言:javascript
复制
C:\Windows\system32>"C:\sonarqube-5.2\bin\MSBuild.SonarQube.Runner.exe" end
SonarQube Scanner for MSBuild 1.1
Default properties file was found at C:\sonarqube-5.2\bin\SonarQube.Analysis.xml

Loading analysis properties from C:\sonarqube-5.2\bin\SonarQube.Analysis.xml
Post-processing started.
MSBuild SonarQube Runner Post-processor 1.0.2.0
11:39:29.774  sonar.verbose=true was specified - setting the log verbosity to 'Debug'
11:39:29.774  Loading the SonarQube analysis config from C:\Windows\system32\.sonarqube\conf\SonarQubeAnalysisConfig.xml
11:39:29.774  Not running under TeamBuild
11:39:29.774  Analysis base directory: C:\Windows\system32\.sonarqube
Build directory:
Bin directory: C:\Windows\system32\.sonarqube\bin
Config directory: C:\Windows\system32\.sonarqube\conf
Output directory: C:\Windows\system32\.sonarqube\out
Config file: C:\Windows\system32\.sonarqube\out
Generating SonarQube project properties file to C:\Windows\system32\.sonarqube\out\sonar-project.properties
No ProjectInfo.xml files were found. Possible causes: you specified an invalid build configuration or the custom MSBuild analysis targets were not imported.
Writing processing summary to C:\Windows\system32\.sonarqube\out\ProjectInfo.log

Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
11:39:29.79  Creating a summary markdown file...
Post-processing failed. Exit code: 1

请告诉我什么是可以解决的,以及如何解决它。

我遵循以下步骤,

  1. 从一个位置执行所有命令-- "D:\Test
  2. 在PATH环境变量a. path添加到MSBUILD的12.0文件夹中
  3. 用于分析指标的命令,a. MSBuild.SonarQube.Runner.exe开始b. MSBuild abc.csproj /t:Clean;Rebuild /p:VisualStudioVersion=12.0...; c. MSBuild.SonarQube.Runner.exe end。
EN

回答 2

Stack Overflow用户

发布于 2016-02-22 05:41:59

我找到解决办法了。

我应该使用MSBuild的完整路径,而不是把它放在path变量中,这就导致了SonarQube分析的问题。

-->

  1. MSBuild.SonarQube.Runner.exe开始
  2. "%programfiles(x86)%\msbuild\12.0\bin\MSBuild.exe“abc.csproj /t:Clean;Rebuild /p:VisualStudioVersion=12.0.
  3. MSBuild.SonarQube.Runner.exe结束

<--

我认为,任何需要Developer提示符的命令也应该在正常的命令提示符中工作,前提是MSBUILD的路径应该是完整的。

你好,上等

票数 4
EN

Stack Overflow用户

发布于 2017-07-14 07:04:05

这个效果很好。:)

在每个选择完成后,使用下面的一行代码:

SonarQube.Scanner.MSBuild.exe begin /k:"ProjectKeyName“/n:"ProjectName”/v:"1.0“

“C:\程序文件(x86)\MSBuild\14.0\Bin\MSBuild.exe”/t:Rebuild

SonarQube.Scanner.MSBuild.exe结束

注意:

请将ProjectKeyname和projectName替换为您的(按照在项目根文件夹下创建的sonar-project.properties文件)

使用版本:声呐-5.6.6(也用声呐-6.4测试),声纳扫描仪-msbuild-3.0.0.629

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35449190

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档