How to change project Name in sonarcloud

Hi Team,
We tried to add -Dproject.Name while running sonar command in gitlab ci-cd.yml
But still the project Name didnt change in sonarcloud UI level.
We can check the project name information only in background tasks show sonarscanner context

how to achieve this in sonarcloud?

Welcome :slight_smile:

with Sonarqube on premise it’s like that =
simply provide a new value for the sonar.projectName property, which then
has an effect with the next analysis.
Should be the same for Sonarcloud.

Gilbert

1 Like

Hello @ServiceAccount_Sonar and welcome to our Community!

Can you try using -Dsonar.projectName instead, as described here?

Hi Alex,
I did try but didnt work as well.

Could you please go to your project at SonarCloud, Administration → Background Tasks. Then for the analysis task where you have added this property, click on the gear icon o the right and select “Show SonarScanner Context”. Please check that you have the property on the output, as this example below:


The property must be there for this to work and with this exact syntax: sonar.projectName (and not project.Name as you mentioned at your first message).

1 Like