diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 41a6ee052..7ddc629f5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -37,9 +37,16 @@ stages: # Sonar scanner does not allow branch name to be set for Pull Requests (PRs), but returns an error if not specified for CI builds. # This conditional block only passes the branch name if build is not for a PR, otherwise it passes the Sonar PR params: ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - extraProperties: 'sonar.branch.name=$(Build.SourceBranchName) sonar.projectKey=james-flynn-ie_spring-petclinic' + extraProperties: | + sonar.branch.name=$(Build.SourceBranchName) + sonar.language=java + sonar.projectKey=james-flynn-ie_spring-petclinic' ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - extraProperties: 'sonar.pullrequest.key=$(System.PullRequest.pullRequestNumber) sonar.pullrequest.branch=$(Build.SourceBranchName) sonar.pullrequest.base=$(System.PullRequest.TargetBranch) sonar.projectKey=james-flynn-ie_spring-petclinic' + extraProperties: | + sonar.pullrequest.key=$(System.PullRequest.pullRequestNumber) + sonar.pullrequest.branch=$(Build.SourceBranchName) + sonar.pullrequest.base=$(System.PullRequest.TargetBranch) + sonar.projectKey=james-flynn-ie_spring-petclinic' # https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/maven?view=azure-devops - task: Maven@3