Setting multiple profile in Sonar-Project.properties

Must-share information (formatted with Markdown):

  • SonarQube 7.5
  • We are analysing project for some specific issues and we have created different profiles for them on sonarqube server (java and javascript).
  • We can not make them default profile
    -We tried to override the sonar quality profile in sonar-project.properties but we found this can only be done for one profile so either we can set the java profile or javascript profile but not both
  • The other solution we tried is to first create the project on sonarqube server , assign this project under all custom quality profiles . This works good but we require the costume profiles to be set in sonar-project.properties .

Hi.

As you found out, you need to create the project on SonarQube server and assign the quality profiles. The usage of sonar.profile parameter is deprecated and will be removed in SonarQube 7.7.

If you don’t want to assign the quality profiles manually, you can use the web API, creating the project through the api/projects/create and setting the quality profiles with api/qualityprofiles/add_project.

1 Like