Template for a good new topic, formatted with Markdown:
- ALM used: Azure DevOps
- CI system used: Azure DevOps
- Scanner command used:
- task: SonarCloudPrepare@1
displayName: Initialize Sonar Cloud Analysis
inputs:
SonarCloud: 'Sonar Cloud <masked>'
organization: <masked>
scannerMode: 'Other'
extraProperties: |
sonar.branch.name=${{ parameters.location_env }}
sonar.verbose=false
sonar.scm.exclusions.disabled=true
sonar.exclusions=<masked>
sonar.coverage.exclusions=<masked>
sonar.sources=src/main/
sonar.tests=src/test/
- task: Maven@4
inputs:
mavenPomFile: '$(Pipeline.Workspace)/${{ parameters.app_name }}/pom.xml'
goals: 'clean install'
options: '--settings $(Pipeline.Workspace)/self/eks/templates/settings.xml'
publishJUnitResults: false
javaHomeOption: 'Path'
jdkDirectory: '/usr/lib/jvm/java-21-amazon-corretto'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: true
sqMavenPluginVersionChoice: 'latest'
env:
SONAR_TOKEN: $(SONAR_TOKEN)
SONAR_PROJECT_KEY: <masked>
SONAR_BRANCH_NAME: "${{ parameters.app_repo_branch }}"
CODEARTIFACT_URL: $(CODEARTIFACT_URL)
CODEARTIFACT_TOKEN: $(CODEARTIFACT_TOKEN)
LOCATION_ENV: ${{ parameters.location_env }}
- task: SonarCloudPublish@1
displayName: Publish Sonar Cloud <masked> Result
inputs:
pollingTimeoutSec: '300'
-
Languages of the repository: Java
-
Error observed : It looks like it is not possible to change to have multiple target branches, only the main one can be used to estimate the improvements after the merge. Is it possible to select a different target via SonarCloudPrepare@1 azure devops task, i.g. having branch x as target for branch y and branch z as target for branch x? If this is not, is it possible to change the main branch for all the projects belonging to a specific group?
Thank you,
Marco