如何失败maven目标声纳:基于质量门规则的声纳?我为本地构建运行它,对于CI,我已根据http://docs.sonarqube.org/display/SONAR/Breaking+the+CI+Build编写了一个脚本 所以,如果质量门验证失败,那么目标也应该失败
如果Sonar Qube版本大于8.1,可以使用以下命令:
mvn verify sonar:sonar -Dsonar.qualitygate.wait=true
Run Code Online (Sandbox Code Playgroud)
您可以使用SonarQube Build Breaker 插件。
这是一个有争议的功能,正如博客文章《为什么你不应该使用 Build Breaker》中所解释的那样。
还可以使用 Web hook 与 Jenkins 集成(请参阅博客文章Breaking the SonarQube Analysis with Jenkins Pipelines)。
| 归档时间: |
|
| 查看次数: |
6848 次 |
| 最近记录: |