I’m using CircleCI to build for SonarCloud, analyzing a Kotlin app. After the first analysis, I had to “rename” the main branch in SonarCloud from ‘master’ to ‘develop’.
In my sonar-project.properties file I have this line with actual info in it:
sonar.projectName=<project number> <customer> <project name>
sonar.projectName=19253 TacoHut Mobile Ordering App
But on the SonarCloud web site the project is named “MyOrg / app”, i.e. the directory the app source is in at /source/app in the repository.
I’ve tried putting the file at the top of the repository as well as in the source directory, but SonarCloud has not updated the project name.
How do I get it to name it as desired on the SonarCloud web site?
What tool are you using to execute SonarCloud analysis? The vanilla Scanner CLI, the Scanner for Maven, Gradle…?
I’m using a job in to the CircleCI build config.yml file, using a run step of:
./gradlew build sonarqube
on the CircleCI email@example.com orb. The gradle file uses plugin id “org.sonarqube” version “184.108.40.2063”, and the sonarqube gradle config includes the properties “sonar.projectKey”, “sonar.organization”, and “sonar.host.url”
Take a look at this thread:
I’ve had the same issue, but you can change the project name in your Gradle file.
Just add the property sonar.projectName to the sonarqube section with your required project name and it will start showing up with that name instead of app.
property "sonar.projectKey", "sonar_projectKey"
property "sonar.organization", "organisation"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.projectName", "android-mobile-app"
Thanks! Moving the setting from the .properties file into the Gradle file seems to have worked.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.