0

我無法在jenkins中運行sonarqube msbuild runner v1.0.2。 構建運行良好,但該插件似乎沒有正確導入聲吶目標。Jenkins MSBuild SonarQube Runner 1.0.2 projectinfo.xml文件未找到

這裏的日誌時聲納構建揭開序幕:

[workspace] $C:\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\MS_Build_Runner_1.0.2\MSBuild.SonarQube.Runner.exe begin /k:my.project /n:myprojectname /v:1.0 /d:sonar.host.url=http://1.1.1.1:9000/ 
MSBuild SonarQube Runner Bootstrapper 1.0.2.0 
Default properties file was found at C:\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\MS_Build_Runner_1.0.2\SonarQube.Analysis.xml 
Loading analysis properties from C:\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\MS_Build_Runner_1.0.2\SonarQube.Analysis.xml 
Pre-processing started. 
Preparing working directories... 
Checking for updates... 
MSBuild SonarQube Runner Pre-processor 1.0.2.0 
10:17:18.025 Loading analysis properties from C:\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\MS_Build_Runner_1.0.2\SonarQube.Analysis.xml 
10:17:18.056 Updating build integration targets... 
10:17:18.072 Fetching analysis configuration settings... 
10:17:21.332 Generating rulesets... 
Pre-processing succeeded. 
Path To MSBuild.exe: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe 
Executing the command cmd.exe /C " C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /p:Configuration=Development /t:Clean,Build /tv:14.0 /p:VisualStudioVersion=14.0 /m:1 /fl2 /flp2:verbosity=diagnostic myprojectname.sln " && exit %%ERRORLEVEL%% from C:\.jenkins\jobs\Technology - WWW - Content Store Client\workspace 
[workspace] $ cmd.exe /C " C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /p:Configuration=Development /t:Clean,Build /tv:14.0 /p:VisualStudioVersion=14.0 /m:1 /fl2 /flp2:verbosity=diagnostic ContentStoreClientSolution.sln " && exit %%ERRORLEVEL%% 
Microsoft (R) Build Engine version 4.6.81.0... 

而且這裏的時候,如果完成:

[workspace] $ C:\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\MS_Build_Runner_1.0.2\MSBuild.SonarQube.Runner.exe end 
MSBuild SonarQube Runner Bootstrapper 1.0.2.0 
Default properties file was found at C:\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\MS_Build_Runner_1.0.2\SonarQube.Analysis.xml 
Loading analysis properties from C:\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\MS_Build_Runner_1.0.2\SonarQube.Analysis.xml 
Post-processing started. 
No ProjectInfo.xml files were found. Possible causes: you specified an invalid build configuration or the custom MSBuild analysis targets were not imported. 
MSBuild SonarQube Runner Post-processor 1.0.2.0 
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis. 
10:21:04.257 Creating a summary markdown file... 
Post-processing failed. Exit code: 1 
ERROR: Execution of MSBuild SonarQube Runner failed (exit code 1) 

插件安裝本身的詮釋,他詹金斯的工具子文件夾。但是,在項目工作區中,我可以看到一個名爲.sonar的文件夾,其中似乎包含所有正確的文件和目標等。

關於爲什麼構建失敗的任何想法?

回答

1

您需要至少使用MSBuild 12(版本14,與VS 2015一起發貨將爲您提供更精確的SonarQube掃描儀版本1.1 for MSBuild & C#插件4.4)的分析結果。

ImportsBefore目標未部署到MSBuild 4.0 - 這就是爲什麼在您的MSBuild執行過程中沒有收集任何信息。我們不會添加對MSBuild 4.0或更早版本的支持。

注意,在即將到來的SonarQube掃描儀的MSBuild的版本1.1,該錯誤信息提ProjectInfo.xml有了大的改進,讓你知道潛在的根本原因:見https://jira.sonarsource.com/browse/SONARMSBRU-180

+0

謝謝迪內希。我已經安裝了MSBuild 14.0,但並沒有更新我的jenkins版本來使用它...所以它仍然使用4.0版本。 – Lee

相關問題