Migration from Bamboo to AzureDevOps - Sonar Analysis not working

Hello, we are stuck within the migration from Bamboo to Azure DevOps.
We are using Sonarqube Developer edition 9.9.1.69595.
The static code analysis and coverage where previously done within our bamboo build plans.
As we are now migrating to AzureDevOps we tried to get the analysis from there back to the sonar projects.
So in SonarQube, we changed the settings for the project to refer to the AzureDevOps as DevOps Platform. Within our pipeline we have the following steps:

  • Checkout the repo
  • SonarQubePrepare@5 (settings: scannerMode: MSBuild, projectKey:<setAccordingOurSonarSettings, and some extra Properties, like the project base dir and the sonar.cs.opencover.reportsPaths)
  • MSBuild@1
  • CmdLineQ2 to run the unit tests with coverage:
\OpenCover.Console.exe -returntargetcode -register:Path64 -output:CodeCoverage.xml -mergebyhash "-target:C:\Build_software\NUnit.Console-3.7.0\nunit3-console.exe" "-targetargs:\nunit-configuration.nunit --result=TestResults/SonarTestResult-UnitTests.xml"
  • SonarQubeAnalyze@5
  • SonarQubePublish@5

(I also tried it without the whole Unit testing to get only the other analysis back but the behaviour is more or less the same)

Within the logs of the analyze step, I see that the analyzed files are found and it looks like everything is fine.
BUT within the SoarQubePublish, the warning appears:
##[warning]No analyses found in this build! Please check your build configuration.

I’m not sure what I can do to fix it… It seems like the publish searches for analysis files in the _temp folder of the agent, and the analyze step is working in the build directory.

Any Ideas how to solve it?
Thank you!

Hey there.

What version of the Extension for Azure DevOps are you using?

Hello, I am responding on Anja’s behalf since she will not be available for a couple of days and we really need to solve this problem:)

Currently we have installed the 5.13.0 (Latest) version.

Thanks.

Can you be more specific about the extra properties that were set?

Sure.

Currently we have these extra properties set:

/d:sonar.exclusions=**/*.js,**/*.tsx,**/*.ts,**/*.less,**/AssemblyInfo.cs
/d:sonar.projectBaseDir=Path_To_Building_Project_Directory
/d:sonar.cs.opencover.reportsPaths=“Path_To_XML_File”

We solved it… The issue was due to an error within the java installation. We found this really by accident as there was no real error message displayed.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.