【问题标题】:The build is configured to run SonarQube analysis but the SonarQube analysis targets could not be located构建配置为运行 SonarQube 分析,但无法找到 SonarQube 分析目标
【发布时间】:2018-11-06 23:36:34
【问题描述】:

我是 .Net 的新手,也是使用 MS Build 的 SonarScanner 的新手。我期待您的帮助,以解决我在 sonarscanner-msbuild 开始过程之后构建项目时遇到的错误。

C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets(62,5): error : The build is configured to run SonarQube analysis but the SonarQube analysis targets could not be located. Project: XYZ.csproj [E:\jenkins\workspace\XYZ\XYZ.csproj]

【问题讨论】:

    标签: sonarqube sonarqube-msbuild-runner


    【解决方案1】:

    提示和线索:

    1. 确保在执行MsBuild之前已经运行SonarScanner.MsBuild begin
    2. 使用/v:diagnostic 开关运行MsBuild 以获取详细的故障排除日志。在日志中查找 SonarQubeTargetsPathSonarQubeTargetFilePath 值。
    3. 如果遇到这种或其他配置困难,请参阅我关于如何在 .NET 生态系统中设置 SonarQube 的教程:https://blog.pragmasoft.pl/software/2018-10-10-sonarqube-2-setup-environment/

    【讨论】:

    • +1 为这个,因为它帮助解决了我的问题;以为我会分享我的案例以进一步提供帮助:在我的案例中,错误是由在“开始”命令之后运行的 clean 和 restore 引起的。我通过确保只在“开始”和“结束”之间运行构建来修复。
    猜你喜欢
    • 2017-12-24
    • 2021-11-24
    • 2015-07-01
    • 2019-11-26
    • 2022-08-08
    • 2019-10-13
    • 2013-09-13
    • 1970-01-01
    • 2016-01-26
    相关资源
    最近更新 更多