如果声纳阈值被突破,如何使哈德森/詹金斯失败? [英] How do I make Hudson/Jenkins fail if Sonar thresholds are breached?
问题描述
我正在使用maven来构建我的Java应用程序,Jenkins用于CI,而Sonar用于度量.
I am using maven to build my java app, Jenkins for CI and Sonar for metrics.
目前,我有一个建筑工作,可以创建声纳报告. (通过詹金斯的构建后步骤触发.)
Currently I have a build job that creates the sonar report. (Triggered via a post-build step in Jenkins.)
如果要满足某些阈值(即任何重大或阻止违反行为或复杂性"大于1.7),我想将其设置为使构建失败.
I would like to set this up to fail the build if certain thresholds are met - i.e. any major or blocker violations or Complexity more than 1.7.
任何指导将不胜感激! -L
Any guidance would be appreciated! - L
推荐答案
安装 build breaker 插件.
如果代码违反了警报阈值您可以在项目的Sonar质量配置文件中指定.
Fails your build if the code breaches any of the alert thresholds you specify on the project's Sonar quality profile.
Sonarqube不再建议使用此插件:
Sonarqube no longer recommends the use of this plugin:
自从我7年前写完这个答案以来,产品似乎已经改变了
It appears the product has changed since I wrote this answer 7 years ago
这篇关于如果声纳阈值被突破,如何使哈德森/詹金斯失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!