使用MSBuild SonarQube Runner v1.0从命令提示符中未找到ProjectInfo.xml文件错误 [英] No ProjectInfo.xml files were found error from command prompt using MSBuild SonarQube Runner v1.0
问题描述
我正在使用新的MSBuild SonarQube Runner v1.0尝试SonarQube.
I'm trying out SonarQube using the new MSBuild SonarQube Runner v1.0.
预处理正常
E:\sonarQube\MSBuild.SonarQube.Runner-1.0>MSBuild.SonarQube.Runner.exe begin /k:"MyKey" /n:"MyProject" /v:"1.0"
.......
Process returned exit code 0
Pre-processing succeeded.
然后MSBuild可以运行
Then MSBuild works
E:\sonarQube\WebApplication2013>msbuild
Microsoft (R) Build Engine version 4.0.30319.34209
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.
........
Done Building Project "E:\sonarQube\WebApplication2013\WebApplication2013.sln" (default targets).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.51
在产生以下错误的结束命令时
While end command following error gets generated
E:\sonarQube\MSBuild.SonarQube.Runner-1.0>MSBuild.SonarQube.Runner.exe end
.......
6:35:10 PM Generating SonarQube project properties file to E:\sonarQube\MSBuild.SonarQube.Runner-1.0\.sonarqube\out\sonar-project.properties
6:35:10 PM No ProjectInfo.xml files were found. Check that the analysis targets are referenced by the MSBuild projects being built.
6:35:10 PM Writing processing summary to E:\sonarQube\MSBuild.SonarQube.Runner-1.0\.sonarqube\out\ProjectInfo.log
6:35:10 PM Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
6:35:10 PM Creating a summary markdown file...
Process returned exit code 1
Post-processing failed. Exit code: 1
需要您的帮助
推荐答案
正如duncanpMS的注释所指出的那样,您需要从要分析的项目文件夹中运行所有这3条命令.
As pointed out by duncanpMS's comment, you need to run all the 3 commands from the folder of the project you want to analyze.
方法如下:
-
cd E:\sonarQube\WebApplication2013
-
E:\sonarQube\MSBuild.SonarQube.Runner-1.0\MSBuild.SonarQube.Runner.exe begin /k:"MyKey" /n:"MyProject" /v:"1.0"
-
msbuild /t:rebuild
-
E:\sonarQube\MSBuild.SonarQube.Runner-1.0\MSBuild.SonarQube.Runner.exe end
cd E:\sonarQube\WebApplication2013
E:\sonarQube\MSBuild.SonarQube.Runner-1.0\MSBuild.SonarQube.Runner.exe begin /k:"MyKey" /n:"MyProject" /v:"1.0"
msbuild /t:rebuild
E:\sonarQube\MSBuild.SonarQube.Runner-1.0\MSBuild.SonarQube.Runner.exe end
您可以将E:\sonarQube\MSBuild.SonarQube.Runner-1.0
添加到%PATH%
环境变量中,以便在分析项目时只需键入MSBuild.SonarQube.Runner.exe
而不是命令行中的完整路径即可.
You can add E:\sonarQube\MSBuild.SonarQube.Runner-1.0
to your %PATH%
environment variable so that you can simply type MSBuild.SonarQube.Runner.exe
instead of the full path from the command line when you analyze projects.
这篇关于使用MSBuild SonarQube Runner v1.0从命令提示符中未找到ProjectInfo.xml文件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!