Reputation: 533
Is there a way to have several profiles for one project in Sonar ?
For example we have a Java EE project with : EJB and WebApp (JSP and Back Bean). We have 3 quality profiles: Java, Web and XML. To "execute" these 3 profiles on our project we run three sonar analysis and create 3 result projects in Sonar.
We use views to regroupe these three projects, is there a way to have one project that use 3 profiles and not use views?
We want to use views to group different projects and not on the same project.
Upvotes: 9
Views: 12400
Reputation: 3188
Just expanding on @guitarium 's answer above:
For SonarQube 7, you can simply do the following on the SonarQube web portal to add extra rules from other profiles into a custom profile (same as merging, really):
Upvotes: 1
Reputation: 17851
You can't have multiple profiles for the same project. But if you want this, you just have to create your own custom profile which has all the rules defined in your profiles. For Example, let's say you have quality profile "Android Lint" and "Sonar Way", and if you wan't to check your project against both these profiles, just do the following:
You now have your own custom quality profile with all the rules that you want.
UPDATE: In the latest version of SonarQube (I am using 6.2), you can use the concept of "Inheritance" to combine multiple quality profiles. You can now set a parent quality profile for any profile. Using this you can chain multiple quality profiles.
Upvotes: 12
Reputation: 608
Applying multiple profiles for one project is not possible.
I see two alternatives: Merging your profiles as already mentioned or scanning the same project under a different "branch" (as in SonarQube terminology).
For a scan under a different branch refer to the sonar quality profile to project association. Please be aware that the syntax of the maven call is actually wrong, use this one instead:
mvn ... -Dsonar.profile="Your profile name" -Dsonar.branch=YOUR BRANCH
Using this will create a new project under the same name plus the branch as postfix. (projectName:branchName)
Regarding the merge of two profiles the easiest way is within the Rules tab:
This will automatically merge the two sets and prevent redundancy.
Upvotes: 2