jenkins - SonarQube Build Breaker does not report failure -


i want fail build in jenkins when code not passing quality gate. reason build breaker plugin not report failure , don't know understand why.

  • sonarqube 4.4
  • build breaker v. 1.1

output jenkins project name , settings renamed.

20:01:07 + mvn sonar:sonar -dsonar.jdbc.url=jdbc:postgresql://something:5432/sonarqube -dsonar.jdbc.username=something -dsonar.jdbc.password=something -dsonar.host.url=http://something -dsonar.jacoco.itreportpath=target/jacoco-it.exec -dsonar.junit.reportspath=target/surefire-reports -dsonar.analysis.mode=preview -dsonar.issuesreport.html.enable=true -dsonar.issuesreport.console.enable=true -dsonar.preview.includeplugins=buildbreaker -dsonar.preview.excludeplugins=devcockpit,jira,pdfreport,views,report,buildstability,scmactivity 20:01:08 [info] scanning projects... 20:01:09 [info]                                                                          20:01:09 [info] ------------------------------------------------------------------------ 20:01:09 [info] building some-project 20:01:09 [info] ------------------------------------------------------------------------ 20:01:10 [info]  20:01:10 [info] --- sonar-maven-plugin:2.4:sonar (default-cli) @ some-project --- 20:01:10 [info] sonarqube version: 4.4 20:01:11 info: default locale: "en_us", source code encoding: "utf-8" (analysis platform dependent) 20:01:11 info: work directory: /var/lib/jenkins/jobs/some-project_review-1/workspace-34_2014-08-18_20-00-17/target/sonar 20:01:11 info: sonarqube server 4.4 20:01:11 [info] [20:01:11.651] preview mode 20:01:11 [info] [20:01:11.656] load global settings 20:01:11 [info] [20:01:11.815] user cache: /var/lib/jenkins/.sonar/cache 20:01:11 [info] [20:01:11.824] install plugins 20:01:11 [info] [20:01:11.845] include plugins: buildbreaker 20:01:11 [info] [20:01:11.845] exclude plugins: devcockpit, jira, pdfreport, views, report, buildstability, scmactivity 20:01:12 [info] [20:01:12.019] create jdbc datasource jdbc:h2:/var/lib/jenkins/jobs/some-project_review-1/workspace-34_2014-08-18_20-00-17/target/sonar/.sonartmp/preview1408392071940-0 20:01:12 [info] [20:01:12.692] initializing hibernate 20:01:17 [info] [20:01:17.535] loading technical debt model... 20:01:17 [info] [20:01:17.653] loading technical debt model done: 118 ms 20:01:17 [info] [20:01:17.666] load project settings 20:01:17 [info] [20:01:17.730] apply project exclusions 20:01:18 [info] [20:01:18.081] -------------  scan project 20:01:18 [info] [20:01:18.086] load module settings 20:01:19 [info] [20:01:19.327] loading rules... 20:01:20 [info] [20:01:20.190] loading rules done: 863 ms 20:01:20 [info] [20:01:20.233] configure maven plugins 20:01:20 [info] [20:01:20.415] compare previous analysis (2014-08-18) 20:01:20 [info] [20:01:20.438] compare on 30 days (2014-07-19, analysis of 2014-08-18 17:26:53.918) 20:01:20 [info] [20:01:20.472] loaded quality gate 'something' 20:01:20 [info] [20:01:20.680] initializer findbugsmaveninitializer...  [a lot of output excluded guess not needed]  20:01:45 [info] [20:01:45.181] export results /var/lib/jenkins/jobs/some-project_review-1/workspace-34_2014-08-18_20-00-17/target/sonar/sonar-report.json 20:01:45 [info] [20:01:45.204] store results in database 20:01:46 [info] [20:01:46.088] analysis successful 20:01:46 [info] [20:01:46.089] executing post-job class org.sonar.issuesreport.reportjob 20:01:46 [info] [20:01:46.601] html issues report generated: /var/lib/jenkins/jobs/some-project_review-1/workspace-34_2014-08-18_20-00-17/target/sonar/issues-report/issues-report.html 20:01:46 [info] [20:01:46.684] light html issues report generated: /var/lib/jenkins/jobs/some-project_review-1/workspace-34_2014-08-18_20-00-17/target/sonar/issues-report/issues-report-light.html 20:01:46 [info] [20:01:46.690]  20:01:46  20:01:46 -------------  issues report  ------------- 20:01:46  20:01:46         +3 issues 20:01:46  20:01:46         +3 major 20:01:46  20:01:46 ------------------------------------------- 20:01:46  20:01:46  20:01:46 [info] [20:01:46.690] executing post-job class org.sonar.plugins.buildbreaker.alertbreaker 20:01:46 [info] [20:01:46.703] executing post-job class org.sonar.plugins.buildbreaker.forbiddenconfigurationbreaker 20:01:46 [info] ------------------------------------------------------------------------ 20:01:46 [info] build success 20:01:46 [info] ------------------------------------------------------------------------ 20:01:46 [info] total time: 38.148s 20:01:46 [info] finished at: mon aug 18 20:01:46 utc 2014 20:01:47 [info] final memory: 35m/744m 20:01:47 [info] ------------------------------------------------------------------------ 20:01:47 finished: success 

according sonarqube need associate project quality gate.

see 1. point in section usage

sonarqube documentation

in case on dashboard clicked on project, in right upper corner click on configuration , quality gate.

it looks default empty , change sonarway (or own). don't forget hit update button


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -