0

I created a Azure DevOps Build pipeline for a .NET Core solution and tried to configure the SonarQube in the build but endup with errors. I followed the steps from the link - 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.

In the Prepare analysis on SonarQube task - I choose the "Integrate with MSBuild" option.

The path it was referring to execute was the c:\VSTSTask_work\1\s. But the sourcecode was in a different location - C:\MaaS

Now I added the Advanced -> additional properties section, I added the below

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

After adding the changes I see the same error.

I also choose the Use standalone scanner and choose - "Store configuration with my source code" and included the sonar-project.properties file in the root location of the solution. I used the link - 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)

I also tried "manually provide configuration" option, but I end up with the same error.

Version details

Azure DevOps SonarQube - Onpremises v 6.7.1 Self hosted agent - Windows 2016 dotnet-sonarscanner v 4.5.0

  • 1
    The SonarQube tasks are expecting to analyse the code from the repo you specified in the build definition, which the build agent will check out to _C:\VSTSAgent\_work\1\s_. Why is the code you are trying analyze under _C:\MaaS_? Are you trying to analyze code that is not in repo specified in the build definition? – duncanp Jan 02 '19 at 18:07
  • @duncanp - For some reason, the code was placed under c:\maas. Now after discussions moved it to the Build agent location. Thanks a lot. – mydevMachine Feb 04 '19 at 22:52

0 Answers0