0

我为 .NET Core 解决方案创建了一个 Azure DevOps 构建管道,并尝试在构建中配置 SonarQube,但最终出现错误。我按照链接中的步骤操作 - https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS

WARNING: File 'C:\***\DocumentDBRepository.CS' is not located under the root directory 'C:\VSTSAgent\_work\1\s' and will not be analyzed. No analysable projects were found. SonarQube analysis will not be performed. Check the build summary report for details.

在对 SonarQube 任务的准备分析中 - 我选择“与 MSBuild 集成”选项。

它所指的执行路径是 c:\VSTSTask_work\1\s。但源代码位于不同的位置 - C:\MaaS

现在我添加了高级 -> 附加属性部分,我添加了以下内容

sonar.exclusions=**/*.bin sonar.cs.vscoveragexml.reportsPaths=**/*.coveragexml sonar.projectBaseDir=C:\maas

添加更改后,我看到相同的错误。

我还选择了使用独立扫描仪并选择 - “使用我的源代码存储配置”并将 sonar-project.properties 文件包含在解决方案的根位置。我使用了链接 - https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild

15:18:22.955 ERROR: Error during SonarQube Scanner execution java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectLock at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64) at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678) at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:265) at org.sonar.scanner.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:118)

我也尝试了“手动提供配置”选项,但我最终得到了同样的错误。

版本详情

Azure DevOps SonarQube - 本地 v 6.7.1 自托管代理 - Windows 2016 dotnet-sonarscanner v 4.5.0

4

0 回答 0