Mohamad Mousheimish
Mohamad Mousheimish

Reputation: 1695

Azure Devops CI pipeline failing when adding SonarQube

I'm trying to add SonarQube into a CI pipeline on Azure DevOps.

My project is .Net Core 2.2 application. The error is related to Agent JDK. I don't know how can I specify the JDK of Microsoft Hosted Agent.

All the tutorials of SonarQube and .NET core pipelines are the same, but none mentioned anything about this issue.

Here's a snapshot about how my pipeline looks like:

enter image description here

Here's the error that's always happening with me. Shouldn't Microsoft Hosted Agent know what capabilities to use by its own?

Anyone have an idea about how we can solve this error?

enter image description here

Upvotes: 1

Views: 321

Answers (1)

Mohamad Mousheimish
Mohamad Mousheimish

Reputation: 1695

The problem was in the JDK used in Micorosft Hosted Machine, for some reason the JDK used was not the supposed one. The solution was following these steps:

  1. Uploading a JDK zipfile to Azure blob storage
  2. Running Java Tool Installer in my Pipeline, giving it the Uploaded zip file as resource
  3. Run Code Analysis successfully finished then and results was published to my SonarQube server

Here's how my pipeline looks like right now:

enter image description here

Upvotes: 1

Related Questions