I am creating a new azure pipeline which builds an apigee proxy using maven & I am trying to integrate sonar into the build process. I’ve struggled to find clear documentation in what is required so hoping I can get some guidance.
The pipeline keeps failing with the following:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project proxy-name: Could not find a default branch to fall back on. → [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project proxy-name: Could not find a default branch to fall back on.
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:306)
Yes the project does already exists in sonarcloud & I have confirmed the key and name matches those variables.
I have tried creating the project manually in sonar as well as onboarding but neither seem to work.
The difference comes from defining sonar.projectKey under extraProperties rather than as a projectKey which does nothing in the context of the Other scanner mode.