Jenkins Findbugs空输出

时间:2016-05-31 15:37:30

标签: java jenkins findbugs

我已经配置了jenkins来运行批处理命令集来编译java文件。我也为该作业启用了findbugs。但是当我构建作业时,我得到的输出如下

No changes.
Started by anonymous user
FindBugs: 0 warnings.

No warnings since build 4.
New zero warnings highscore: no warnings since yesterday!
During parsing an error has been reported.

当我点击错误时,我得到的是

Errors

No report files were found. Configuration error?

我的工作配置如下所示 enter image description here

如果我在jenkins外面运行findbugs,我会得到正确的输出

enter image description here

我的Java文件看起来像这样

class Input {
public static void main(String[] args) {
    System.out.println("Hello World! "); // Display the string.


    String str = null;
    if(str.equals("Test")) {
 /* The code here will not be reached, as an exception will be thrown. */
    }
}}

1 个答案:

答案 0 :(得分:1)

FindBugs插件搜索 findbugs.xml 并生成报告。这意味着你必须先运行findbugs。

  

FindBugs插件扫描构建工作区中的findbugs.xml文件,并报告找到的警告数。此插件是静态代码分析插件套件的一部分,这些插件记录在单独的WIKI页面上。   (source

但您可以在手动(more information)之前运行findbugs:

java -jar $FINDBUGS_HOME/lib/findbugs.jar
相关问题