title: Jenkins Script Pipeline sonar Integration
body: <p>i'd like to start a Sonar project analysis with Jenkins 2.x Groovy Script Build Pipeline. </p>
  
  <p>I have sonar configured in Maven so thats no big deal:</p>
  
  <pre><code>withEnv(["JAVA_HOME=${javaHome}", "PATH + MAVEN=${mavenHome}/bin:${env.JAVA_HOME}/bin", "MAVEN_OPTS=${mavenOpts}"]) {
          sh 'mvn -B sonar:sonar'
  }
  </code></pre>
  
  <p>But how can i get results from sonar ? Or even better how can i determine if a quality gate was achived so that i can stop the  build-pipeline. </p>
  
  <p>The build breaker concept is obsolet since some versione of sonar, as far as i know. Or how would you handle this.</p>
  
  <p>I still think it would be a good idea to stop/pause a build pipeline if the underlying code of a project is too bad. </p>