1

我正在通过 Ant 任务运行 spotbugs,但我无法将结果发布到 jenkins。我收到以下错误

[FindBugs] No valid reference build found that meets the criteria (NO_JOB_FAILURE - SUCCESSFUL_QUALITY_GATE)
[FindBugs] All reported issues will be considered outstanding

这是我正在使用的詹金斯脚本

stage('Publish Spotbugs')
            {
                def findbugs = scanForIssues tool: [$class: 'FindBugs'], pattern: '**/findbugsXml.xml'
                publishIssues issues:[findbugs]
            }
4

1 回答 1

2

您写道您正在使用 Spotbugs。在您的管道中,您使用的是 Findbugs Publisher。Spotbugs 是 Findbugs 的一个分支。如果您真的在使用 Spotbugs,我建议您改用 Spotbugs Publisher。

stage('Publish Spotbugs')
{
  def spotbugs = scanForIssues tool: spotBugs(pattern: '**/target/findbugsXml.xml')
  publishIssues issues: [spotbugs]
}

报告 XML 文件名取决于您的配置。也可以是spotbugsXml.xml。运行 ant 任务后是否验证了目标文件夹?

有关警告下一代插件的管道配置的更多信息,请参阅github 上的文档jenkins 用户文档

于 2019-08-24T14:31:48.293 回答