Unable to Run Analysis on Bitbucket Repository

I am using Java 8 and have a Maven Spring Boot Project.
My sonar-maven-plugin version is 3.6.0.1398.
I’m able to run sonar scans on all my Bitbucket projects except this one.
I have defined my sonar project key in my pom.xml as the follows:

	<properties>
		<java.version>1.8</java.version>
		<sonar.organization>xx</sonar.organization>
		<sonar.host.url>https://sonarcloud.io</sonar.host.url>
		<sonar.projectKey>xxx</sonar.projectKey>
	</properties>

but when I am trying to run the sonar scan through Bitbucket Pipelines, I’m getting:

`[WARNING] Failed to check if project 'xxx' is bound`
`[INFO] Detected project binding: ERROR`
`[INFO] Load project pull requests (done) | time=165ms`
`[INFO] Load branch configuration`
`[INFO] Total time:  50.047 s`
`[INFO] Finished at: 2024-09-24T09:26:23Z`
`[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli)`

Fixed this by adding SONAR_TOKEN in my repository variables.

1 Like