Sonarqube doesn't rename a project for which the main branch has no analysis

Using

  • Sonarqube 9.9-LTS (9.9.2.77730) deployed on docker
  • Sonar Scanner 5.0.1.3006

I try to rename (via the definition of sonar.projectName property) the name of a project. If the project doesn’t have a main branch analysis, Sonarqube doesn’t rename the project.

Steps to reproduce:

  1. execute a branch analysis in the project : sonar-scanner.bat “-Dsonar.projectName=albator” “-Dsonar.projectKey=sbtest.092023” “-D sonar.java.binaries=target/classes” “-Dsonar.branch.name=develop”
  2. consult the project in Sonarqube, it has the right name “albator”
  3. execute another analysis with a new projectName to rename the project in Sonarqube : sonar-scanner.bat “-Dsonar.projectName=cobra” “-Dsonar.projectKey=sbtest.092023” “-D sonar.java.binaries=target/classes” “-Dsonar.branch.name=develop”
  4. consult the project in Sonarqube, it has the old name “albator” and not the new name

Seems to be a bug, doesn’t it ?

Filed as SUPPORT-42274

Hey there.

We don’t consider it a bug – it’s known behavior that to update the project name, the project name must be passed to an analysis of the main branch. We’d prefer there to be one source of truth, instead of the analysis of any random branch being able to change it for everyone.

It seems a reasonnable option. But where is it documented ?

Fair. I’ll ping our Docs team to see if we can find a place for it.

Hi Frédéric, thank you for pointing this out.
I will create a ticket in order to add this information to the documentation.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.