As an aside (until auto-configuration works properly): What is the minimal configuration I need to pass to the scanner to avoid auto-configuration? Previously, we were setting scm.branch for non-default branches, but how do I force a branch to BE the default branch?
Hi @TobiX ,
Thank you for your feedback
To answer you properly, I need some more information :
What edition of SonarQube do you use? (FYI Community Edition doesn’t provide the support for branches)
What is the DevOps Platform where your code is hosted?
What is your build tool? (Maven, gradle, .NET, etc)
Also,
when analysing a project with a different default branch for the first time, that branch is created as a non-default branch
I’m surprised. Normally the default branch should be fetched automatically by SonarQube. It’s retrieved from the SCM you use, when available (the git protocol itself doesn’t know the principle of a “default branch”).
The SonarQube plugin should pass the branch name automatically to the scanner when triggering the analysis.
The code is hosted on an on-premise GitLab instance
This build is running with Maven
I just realized there might be something wrong on my side - since our Jenkins setup is a bit “special” (okay, which Jenkins setup isn’t?), which might impact the scanner’s ability to detect the “correct” repository and branch…