title: Sonar and Maven artifact deployment
body: <p>I'm trying to come up with a pattern of continuous integration in which our Maven project will only deploy artifacts if certain quality thresholds have been met.  We're using Sonar to run the quality reports, but it seems that I have to run:</p>
  
  <pre><code>mvn clean install sonar:sonar &amp;&amp; \
  mvn deploy -DskipTests -DskipITs
  </code></pre>
  
  <p>(or rather its equivalent as separate Jenkins build steps).</p>
  
  <p>This involves building the code twice, therefore making each overall build job too long for continuous integration.</p>
  
  <p>If I run a one-liner like:</p>
  
  <pre><code>mvn clean deploy sonar:sonar
  </code></pre>
  
  <p>the artifacts are deployed to the repository before Sonar is run.  Without moving away from Maven, is there a better solution?</p>