2

I am implementing SonarQube on my Azure Build Pipeline.

Below is my task pipeline and the error. It will get error on the 3 task I added from SonarQube.

Anyone knows how can I fix this? If I remove the 3 task from SonarQube it works all fine. But I needed the SonarQube.

enter image description here

enter image description here

  • 3
    The error message is quite self-explanatory: your agent is missing java, which is required by the SonarQube build tasks. The quote from [the SonarQube docs](https://docs.sonarqube.org/latest/analysis/azuredevops-integration/): "If you are self-hosting the build agents, make sure you have at least the minimum SonarQube-supported version of Java installed." – Yan Sklyarenko Nov 16 '21 at 07:44
  • Hi @YanSklyarenko, Thanks I'll check on the agent pools. – Anthony Earl R. Cuartero Nov 16 '21 at 08:09
  • Hi @YanSklyarenko, I check the agent pool there is no java. How can I add java on my agent? Sorry I'm a beginner on azure devops. – Anthony Earl R. Cuartero Nov 16 '21 at 08:27
  • You should just install java the normal way on a machine running the agent. Make sure to restart the agent afterwards so that it picks the env changes. – Yan Sklyarenko Nov 16 '21 at 08:51
  • I see, I already installed java on the virtual machine which the agent is running. I also tried "java -version" and it displays version 11.0.13. Now it still cause the error. I'll try to restart the Agent. – Anthony Earl R. Cuartero Nov 16 '21 at 08:54
  • FYI the build agents run a discovery process at startup to find out which "capabilities" are supported by the agent machine i.e. restarting the agent is necessary you've changed the capabilities. – duncanp Nov 16 '21 at 09:41
  • Hi, I still didn't fix the issue even though I already installed java version 11 and already restarted the vm or agent pool. – Anthony Earl R. Cuartero Nov 16 '21 at 11:56
  • @AnthonyEarlR.Cuartero Did you manage to find a solution yet? – Tim Chermin Sep 05 '22 at 11:54

0 Answers0