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>
Expanding on the previous answer given by Eldad AK regarding profiles:
Create two maven profiles as follows:
Dev_${sonar.profile}
QualityProfileOne
MyQualityProfile1
QualityProfileTwo
MyQualityProfile2
Then run the following:
$ mvn clean install -DskipTests
$ mvn sonar:sonar -PQualityProfileOne
$ mvn sonar:sonar -PQualityProfileTwo
(you may need to perform a clean between running sonar, not sure)