We run SonarQube analyses for our Java projects via Maven. Maven somehow does this automagically; all we did was add the sonar-maven-plugin
to our pom.xml>
Try to configure two executions of your plugin. Something like this:
org.codehaus.mojo
sonar-maven-plugin
s1
verify
sonar
MyQualityProfile1
s2
install
sonar
MyQualityProfile2
This will start two executions of sonar in phases verify and install, each with another sonar.branch value. In Sonar you can then configure the required quality profiles after the first analysis.