SonarQube is now a real reviewer! SonarQube Stash (BitBucket) plugin is a pull request decorator that displays SonarQube issues on pull request.
After every run, in addition of the diff view, you may access an overview of the SonarQube analysis:
- Git client to checkout the code
- Maven 3.0.5
- JDK 1.7
- SonarQube 4.5.4 (LTS)
- Stash (BitBucket) 3.x
This command generates a jar file.
mvn clean install
Just copy the sonar-stash-plugin jar file to the plugin folder of the expected SonarQube server and restart the SonarQube server. For instance, on Linux platform:
~> cp target/sonar-stash-plugin-X.X.jar $SONARQUBE_HOME/extensions/plugins
Go to Settings > Configuration > General Settings > Stash:
To activate the plugin, add the following options to the SonarQube runner (for instance with SonarQube Scanner):
For SonarQube 5.2+:
sonar-runner -Dsonar.analysis.mode=preview -Dsonar.stash.notification=true -Dsonar.stash.project=<PROJECT> -Dsonar.stash.repository=<REPO> -Dsonar.stash.pullrequest.id=<PR_ID> -Dsonar.stash.password=<STASH_PASSWORD>
Before SonarQube 5.2:
sonar-runner -Dsonar.analysis.mode=incremental -Dsonar.stash.notification=true -Dsonar.stash.project=<PROJECT> -Dsonar.stash.repository=<REPO> -Dsonar.stash.pullrequest.id=<PR_ID> -Dsonar.stash.password=<STASH_PASSWORD>