【问题标题】:SonarQube analysis could not be completed because the analysis configuration file could not be found由于找不到分析配置文件,SonarQube 分析无法完成
【发布时间】:2017-12-24 20:41:10
【问题描述】:

当我将 xamarin 应用程序与 windows 服务器上的 jenkins 集成时,SonarQube 给我以下错误

SonarQube Scanner for MSBuild 3.0
Default properties file was found at C:\SonarQube\bin\SonarQube.Analysis.xml
Loading analysis properties from C:\SonarQube\bin\SonarQube.Analysis.xml
Post-processing started.
13:49:43.952  SonarQube analysis could not be completed because the analysis configuration file could not be found: C:\Users\Administrator\.jenkins\workspace\Xamarin-ProjectTemplate\.sonarqube\conf\SonarQubeAnalysisConfig.xml.
13:49:43.952  Post-processing failed. Exit code: 1

我已遵循以下指南https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild

SonarQube.Scanner.MSBuild.exe begin /k:"org.sonarqube:sonarqube-scanner-msbuild" /n:"Project Name" /v:"1.0"
MSBuild.exe /t:Rebuild
SonarQube.Scanner.MSBuild.exe end

请帮我解决这个问题

【问题讨论】:

  • 我遇到了同样的错误...为了让它工作,而不是MSBuild.exe /t:Rebuild,你只需要使用MSBuild.exe

标签: c# jenkins continuous-integration sonarqube sonarqube-scan


【解决方案1】:

我遇到了这个问题,因为我在里面使用了错误的项目密钥(它有一个})。我删除了},问题就消失了。

【讨论】:

    【解决方案2】:

    我遇到了同样的错误,并且能够通过从第二步中排除“/t:Rebuild”来修复它。还使用了VS2017 MSBuild.exe

    这些是我在 Windows 命令提示符 (CMD) 中运行的 3 个命令:

    1>> SonarScanner.MSBuild.exe begin /k:"MyProjectName"
    
    2>> "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/MSBuild.exe" "MySolution.sln" 
    
    3>> SonarScanner.MSBuild.exe end
    

    【讨论】:

      【解决方案3】:

      SonarQube 报告末尾报告的错误有时不如您开始时报告的错误有用。

      例如,当我收到此错误时,滚动到日志顶部显示我没有正确设置 sonar.projectKey 值,但 OP 共享的这条消息仍然是最后出现的消息。

      【讨论】:

      • 这对我有帮助。我在顶部附近发现了这个错误:“无效的项目密钥。允许的字符是字母数字、'-'、'_'、'。'和 ':',至少有一个非数字。”
      【解决方案4】:

      我遇到了同样的问题。你需要找到正确的MSBuild.exe

      我在c:\Windows\Microsoft.NET\Framework64\...c:\Program Files (x86) 中有几个 对于我在Visual Studio 2017.NETFramework,Version=v4.6.1 中的项目,正确的MSBuild.exe 是:

      "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MSBuild.exe"  /t:Rebuild
      

      对于Enterpsie版本应该是:

      "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild" /t:Rebuild
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-01-26
        • 1970-01-01
        • 2017-04-30
        • 2016-03-15
        • 2017-08-16
        • 1970-01-01
        • 2015-11-28
        • 1970-01-01
        相关资源
        最近更新 更多