首页 > 解决方案 > Jenkins 警告发布者在构建时失败

问题描述

我有一个创建 flake8 报告并使用警告发布者的 checkstyle 阶段。当我运行构建时,出现以下错误。

我也安装了“静态分析收集器插件”。

withEnv(["VIR_ENV=$env.WORKSPACE/venv"]){
            stage ('Check_style') {
                 sh """
                    #. venv/bin/activate
                    export PATH=${VIRENV}/bin:${PATH}
                    echo $PATH
                    make flake8 | tee test-report/flake8.log || true
                """
                step([$class: 'WarningsPublisher',
                  parserConfigurations: [[
                    parserName: 'Pep8',
                    pattern: 'report/flake8.log'
                  ]],
                  unstableTotalAll: '0',
                  usePreviousBuildAsReference: true
                ])
            }
        }

错误:-

Build failed with Error: java.lang.IllegalArgumentException: Could not instantiate {delegate={$class=WarningsPublisher, parserConfigurations=[{parserName=Pep8, pattern=report/flake8.log}], unstableTotalAll=0, usePreviousBuildAsReference=true}} for CoreStep(delegate: 

标签: jenkinsjenkins-pluginsjenkins-pipeline

解决方案


推荐阅读