【问题标题】:Jenkins Findbugs Empty outputJenkins Findbugs 空输出
【发布时间】:2016-05-31 15:37:30
【问题描述】:

我已将 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?

我的工作配置是这样的

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

我的 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. */
    }
}}

【问题讨论】:

    标签: java jenkins findbugs


    【解决方案1】:

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

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

    但你可以手动运行 findbugs (more information):

    java -jar $FINDBUGS_HOME/lib/findbugs.jar
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多