How do I make Hudson/Jenkins fail if Sonar thresholds are breached?(如果违反声纳阈值,我如何让 Hudson/Jenkins 失败?)
问题描述
我正在使用 maven 构建我的 java 应用程序,Jenkins 用于 CI,Sonar 用于指标.
I am using maven to build my java app, Jenkins for CI and Sonar for metrics.
目前我有一个创建声纳报告的构建作业.(通过 Jenkins 中的构建后步骤触发.)
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
推荐答案
安装 构建断路器插件.
如果代码违反任何 警报阈值 您在项目的 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:
- http://www.sonarqube.org/why-你不应该使用build-breaker/
自从我 7 年前写这个答案以来,产品似乎发生了变化
It appears the product has changed since I wrote this answer 7 years ago
- https://blog.sonarsource.com/打破声纳分析与詹金斯管道/
这篇关于如果违反声纳阈值,我如何让 Hudson/Jenkins 失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如果违反声纳阈值,我如何让 Hudson/Jenkins 失败?
基础教程推荐
- 降序排序:Java Map 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01