Code Scanning fails for feature branch with new code relative to master branch


we are using the developer edition and according to the docs we have configured new code for our project as follows. All (feature) branches relative to the master branch and the master branch itself uses previous version for new code. With this set up and building a Java project with Jenkins we face the following errors in the log output of Jenkins:

08:26:18 [main] INFO org.sonarsource.scanner.maven.SonarQubeMojo - Computing New Code since fork with 'master'
08:26:18 [main] WARNING org.sonarsource.scanner.maven.SonarQubeMojo - Could not find ref 'master' in refs/heads, refs/remotes, refs/remotes/upstream or refs/remotes/origin
08:26:18 [main] WARNING org.sonarsource.scanner.maven.SonarQubeMojo - Branch 'master' not found in git
08:26:18 [main] WARNING org.sonarsource.scanner.maven.SonarQubeMojo - Failed to detect fork date. No New Code will be computed.

We are using Bitbucket server, which is configured in Sonar and integration works, since we get PR decoration and connection seems to be fine.

I did a research and found some articles talking about similar problems and their solution had been to exchange the scm-git plugin. But in our version of SonarQube the plugin is integrated and cannot be updated.

Hence we are stuck at this point.

Is this just a configuration issue or what needs to be done in order to achieve code scanning in this scenario?



Welcome to the community!

Does either of these threads help?