SonarQubeAnalyze@7 - Run Code Analysis v7 task

Run scanner and upload the results to the SonarQube server.

Note

The SonarQube tasks are part of the SonarQube extension for Azure DevOps, which is pre-installed in Azure DevOps Services. For more information and support for SonarQube and SonarQube tasks, see SonarQube extension for Azure DevOps, SonarQube - Visual Studio Marketplace, and Sonar Community.

Syntax

# Run Code Analysis v7
# Run scanner and upload the results to the SonarQube Server.
- task: SonarQubeAnalyze@7
  inputs:
    jdkversion: 'JAVA_HOME_17_X64' # 'JAVA_HOME' | 'JAVA_HOME_17_X64' | 'JAVA_HOME_21_X64'. Required. JDK version source for analysis. Default: JAVA_HOME_17_X64.

Inputs

jdkversion - JDK version source for analysis
string. Required. Allowed values: JAVA_HOME (Use JAVA_HOME), JAVA_HOME_17_X64 (Use built-in JAVA_HOME_17_X64 (hosted agent)), JAVA_HOME_21_X64 (Use built-in JAVA_HOME_21_X64 (hosted agent)). Default value: JAVA_HOME_17_X64.

Select the wanted Java version for the analysis : You can choose with either Self provided JAVA_HOME which will pick up the value of this env variable, or you can choose the built-in JAVA_HOME_XX_X64 value on hosted agent. Default value is JAVA_HOME_17_X64, however if you choose either of the proposed value and they are not available, JAVA_HOME value will be picked up instead.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Remarks

Note

The SonarQube tasks are part of the SonarQube extension for Azure DevOps, which is pre-installed in Azure DevOps Services. For more information and support for SonarQube and SonarQube tasks, see SonarQube extension for Azure DevOps, SonarQube - Visual Studio Marketplace, and Sonar Community.

Requirements

Requirement Description
Pipeline types YAML, Classic build
Runs on Agent, DeploymentGroup
Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: java
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 3.218.0 or greater
Task category Build