Template for a good new topic, formatted with Markdown:
- ALM used : Bitbucket
- CI system used : Bitbucket Cloud
- Languages of the repository : JAVA
- Error observed : Could not find a default branch to fall back on
Hello,
I’m using SonarCloud to analyze a JAVA/MAVEN project. The project is on Bitbucket and the SonarCloud analysis is launched from a Bibbucket pipeline.
In Bitbucket, my “main branch” is set to the “master” branch.
The pipeline is launched by the following YML script:
image: maven:3-amazoncorretto-11
clone:
depth: full
definitions:
steps:
- step: &verify-sonar
name: Build and test
caches:
- maven
script:
...
- bash create-settings.sh
- mvn -s settings.xml -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey="pgsConfiguration"
artifacts:
- target/**
pipelines:
default:
- step: *verify-sonar
But the BitBucket pipeline gives me the following error:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project faberConfiguration: Could not find a default branch to fall back on. → [Help 1]
This error occurs since I changed the “main branch” in the project.
How can this problem be corrected?
Regards