From 8f0d18a9c73c3ec6d43b75b2b8f56952b1c4fb7b Mon Sep 17 00:00:00 2001 From: James Flynn Date: Tue, 2 Mar 2021 16:30:47 +0000 Subject: [PATCH] Changed: extra properties structure --- azure-pipelines.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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