Changed: extra properties structure

This commit is contained in:
James Flynn 2021-03-02 16:30:47 +00:00
parent fc95a32d05
commit 8f0d18a9c7

View file

@ -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. # 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: # 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') }}: ${{ 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') }}: ${{ 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 # https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/maven?view=azure-devops
- task: Maven@3 - task: Maven@3