February 24, 2023, 10:05am
This question is related to:
Projectkey without organization name in SonarCloud
What I need to know is if there is a way of chosing the projectKey in the moment of the creation of the project.
This project is created in bitbucket pipelines using mvn sonar:sonar with a custom projectKey that does not contain the organization name on it.
If I try to execute the command withouth first creating the project manually in SonarCloud it fails.
It works if I create the project manually and then I update the projectKey manually in SonarCloud to what I want.
It works also if I execute the command locally in my computer and not in the Bitbucket Pipelines environment (it creates the project in SonarCloud correctly with the custom project key)
Is there a way of creating the project with a custom projectKey in the Bitbucket Pipelines environment directly? We are migrating from Sonarqube to SonarCloud and we were doing this automation before.
February 27, 2023, 9:27am
You would need to make sure that the user running analysis has the
Create Projects permission in your organization, but warning ( ) you will not benefit from bound projects, meanign features like Pull Request Decoration won’t work.
February 27, 2023, 12:54pm
Ah ok thanks!! Then I will learn how to live with the organization name there because I dont want to lose the rest of the features xD
February 27, 2023, 1:35pm
Don’t forget you can change the project key (project
Administration > Update Key)
February 27, 2023, 1:50pm
So if I create the project manually in the website with the default projectKey and then I update it to my custom value, I won’t lose the benefits of bound projects?
February 27, 2023, 1:51pm
Correct. The project key is just a unique identifier, which is automatically generated because most users are fine with the default value. The binding is something separate, and isn’t lost if you change the project key.
February 27, 2023, 2:19pm
Great then many thanks!! I will proceed like that
March 6, 2023, 2:19pm
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.