title: How can I use Sonar maven plugin to validate local code against Quality Gate?
body: <p>We have our project integrated with SonarQube remote server, with a <strong>Quality Gate</strong> configured.
  Everytime we commit in master our gitlab executes that sonar:sonar and if the code doesnt meet the Quality Gate metrics , the build is rejected.</p>
  
  <p>I would like to do the same in local before pushing to Gitlab.</p>
  
  <p>If I execute <strong>sonar:sonar</strong> in local pointing to the remote SonarQube server it verifies the Quality Gate and persists the metrics in the server.</p>
  
  <p>But, I would like to do the same without persisting the metrics as it's my own branch.
  So, if I use <strong>-Dsonar.analysis.mode=preview</strong> it doesnt persist metrics <strong>but it doesnt check the metrics ( Quality Gate )</strong></p>
  
  <p>Is there any way to do it ?</p>