软件CI

1、代码静态检查–findbugs
findbugs配置过滤规则
https://stackoverflow.com/questions/23550195/how-do-i-configure-the-findbugs-maven-plugin-to-only-check-for-annotation-violat

在pom.xml中配置使用findbugs插件

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>findbugs-maven-plugin</artifactId>
    <version>2.4.0</version>
    <configuration>
        <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
        <findbugsXmlOutput>true</findbugsXmlOutput>
        <xmlOutput>true</xmlOutput>
    </configuration>
</plugin>

The findbugs-exclude.xml file is in my project root directory (same level as pom.xml - I should probably put it somewhere better), and it configures what findbugs issues I want to ignore. Here’s what’s in my exclude file:

<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
    <Match>
        <Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
    </Match>
    <Match>
        <Package name="com.mypackage.something"/>
    </Match>
</FindBugsFilter>

There’s more info about configuring the findbugs filter files in the findbugs manual
http://findbugs.sourceforge.net/manual/filter.html#

Maven集成Findbugs至compile阶段(excludeFilterFile 属性必须配置在 plugin 节点下)
https://blog.csdn.net/rainbow702/article/details/54138155

2、使用 SonarQube Scanner 进行代码分析 08月16日 2016
https://jaminzhang.github.io/ci/cd/Analyzing-code-with-SonarQube-Scanner/#top5

2.1、使用 Jenkins 与 Sonar 集成对代码进行持续检测 --曲世明 和 陈计云 2016 年 12 月 13 日
https://www.ibm.com/developerworks/cn/devops/1612_qusm_jenkins/index.html

2.2、SonarQube7.3安装和使用说明 2018-08-27
https://blog.csdn.net/weixin_40861707/article/details/82117232

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值