I have this sonarqube developer 9.3, sonarscanner for Azure DevOps Pipeline version 4.18 and msbuild 15.0.
I have performed sonar scanner process with Azure pipeline to analyze the code following the steps of the SonarQube guide:
- Use Prepare Analysis on SonarQube Task setting the variables:
- SonarQube EndPoint: define with the token to access to SonarQube
- Choose the way to run the analysis: use standalone scanner
- Mode: Manually provide configuration
- Project Key: PROJECT
- Project Name: PROJECT
- Project Version: $(Build.BuildNumber)
- Sources directory Root: .
- Additional Properties: sonar.cfamily.build-wrapper-output=$(Build.SourcesDirectory)\sonar
- Use a powershell script that execute:
- build-wrapper-win-x86-64.exe --out-dir $(Build.SourcesDirectory)\sonar msbuild.exe solution.sln /t:Rebuild
- Use Run Code Analysis Task
- Use Publish Quality Gate Result Task
Where solution.sln is coded in c++ and has diferent vcprojs.
When we launch the pipeline, two first task work well, but when Run Code Analysis task is running happens an error:
##[error]: Error during SonarScanner Execution
ERROR: Error during SonarScanner execution
##[error]java.lang.IllegalStateException: java.nio.file.NoSuchFileException: $(Build.SourcesDirectory)\sonar\build-wrapper-dump-json
It’s important to said that json file doesn’t exist in that folder, I have put different folders but that file never create during the build task.
On the other side, if I do the steps with with SonarScanner via command line in local, the measures was correctly analyzed and published in SonarQube server.
Can anyone help me with this problem?
Thanks in advance.