Java demand in Run Code Analysis job in Azure DevOps

Hi there,

we are currently using the SonarQube plugin in our pipeline.

This suggestion is concerning the Run Code Analysis job, available in Azure DevOps.

Once the job is added to the build, the demand “java exists” is added to the agent. In the transition from JDK to OpenJDK we found that the installation of OpenJDK doesn’t create the demand java. However, because it’s necessary for the Run Code Analysis job our agent can’t execute the entire build.

Is it possible to change this demand? For example, the JAVA_HOME environment variable is present with the OpenJDK installation. This demand is available for the agent to use.

Demands explained by Microsoft documentation

Greetings,

This thread should help you understand why this is going on:

Colin

Hi Colin,

thank you for your reply.

My request is not entirely what you’re suggesting. What we would like is that the demand doesn’t strictly look at java only, so for instance java or java_home as demand.

@sudo-md the community post @Colin_SonarSource referred you to explains why we can’t change the demands in our Marketplace extension. To summarise, changing the demand to only java_home would break some use cases, and we can’t demand java or java_home as that isn’t supported by Microsoft.