I’m trying to build a java maven project, but I’m getting [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project proj: You’re not authorized to run analysis. Please contact the project administrator. → [Help 1], even though I’m explicitly passing the url and access token along with maven command build.
Build command used: mvn clean install -Dmaven.test.skip=true sonar:sonar -Dsonar.host.url=https://sonarqube.it.org.net -Dsonar.login=token
application.yml:
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- none
pool:
vmImage: windows-latest
name: custom_network
steps:
- task: SonarQubePrepare@5
inputs:
SonarQube: 'project-sonarqube'
scannerMode: 'Other'
projectKey: com.org.proj.java
projectName: proj.java
extraProperties:
sonar.projectKey=com.org.proj.java
sonar.projectName=proj.java
- task: MavenAuthenticate@0
inputs:
artifactsFeeds: 'Proj_Artifacts'
- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
goals: 'clean install -Dmaven.test.skip=true sonar:sonar -Dsonar.host.url=https://sonarqube.it.org.net -Dsonar.login=token'
publishJUnitResults: false
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: true
effectivePomSkip: false
sonarQubeRunAnalysis: true
- task: SonarQubePublish@5
inputs:
pollingTimeoutSec: '300'