The azure pipeline task SonarQubeAnalyze@7 creates a hidden demand java in the pipeline

We have installed the SonarQube Server 10 version.
This provide its own Java runtime for the azure analysis pipeline tasks. This means that Java Runtime no longer needs to be installed on the build server. Nevertheless, the pipeline task SonarQubeAnalyze@7 generates a hidden demand java and the build is not started on any agent that does not have the java capability. This should not be the case.

I testet it with SonarQubeAnalyze@7.3.0, 7.2.0 and 7.1.1 all the same issue.

Error from the pipeline:
##[error]No agent found in pool Default which satisfies the following demand: java. All demands: java, Agent.Version -gtVersion 3.218.0

Hey there.

Java 17 is still required at the agent level, since it’s a Java runtime that downloads the version of Java available on the SonarQube server.

While that might not seem super useful now – when we decide to upgrade to Java 21 in the future, you won’t have to worry about whether or not Java 21 is installed on your build agents.

1 Like

Thanks @Colin for the clarification.
The docs were misleading to us:

Depending on your SonarScanner, JRE may be auto-provisioned. JRE auto-provisioning is currently supported by:

  • SonarScanner CLI, from version 6.0.
  • SonarScanner for .NET, from version 7.0.

It is not mentioned, that for auto-provisioning to work already a Java runtime needs to be available. As the SonarScanner for .NET support auto-provisioning, we understood that Java can be removed from the build servers. Now installed a newer Java 17 again on the build servers.

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