We have a fixed naming pattern for our projects
- app - trunk
- app-1.2.0 - branch for the 1.2.0 version
- app-1.3.0 - branch for the 1.3.0 version
When creating a new branch we need to associate the group "app" to the new branch project app-[0-9]\.[0-9]\.[0-9] after the first Sonar analysis has been run.
In Jenkins there is a "Role Strategy Plugin" (https://wiki.jenkins-ci.org/display/JENKINS/Role+Strategy+Plugin) that allows to assign roles to projects, selected by a regular expression pattern:
This ties all projects, matching the pattern "(app|app-.*)", to the "app" group.
In Sonar there could be a similar mechanism in the Security -> Project Roles. A new entry could define a pattern for projects instead of defining a new project role for each new project.