1、xml files are generated in the WORKSPACE directory. As follows:
      cppcheck --enable=all --inconclusive --xml --xml-version=2  "${file_name}" 2>"${WORKSPACE}/cppcheck-result.xml"

      2、Call the publishCppcheck plug-in to get the data. As follows:
      stage("Push_cppcheck_result") {
          steps {
              updateGitlabCommitStatus name: 'Jenkins', state: 'running'
              publishCppcheck pattern: "cppcheck-result.xml"
          }
       
      3、Running result

      4、No result file is generated on the primary server

          [JENKINS-71767] publishCppcheck do not work in the pipeline

          xiangfei added a comment -

          xiangfei added a comment - Jenkins version:2.401.1 Cppcheck Plug-in version:1.26 { }

          Chris added a comment -

          Jenkins version: 2.426.1

          Cppcheck Plug-in version: 1.26

           

          I also am seeing this bug intermittently. When creating the xml file via cppcheck command, the file gets created, but Jenkins will intermittenly fail when [Cppcheck] Starting the cppcheck analysis. Usually takes a minute or two before it fails at displaying the cppcheck results. 

          Chris added a comment - Jenkins version: 2.426.1 Cppcheck Plug-in version: 1.26   I also am seeing this bug intermittently. When creating the xml file via cppcheck command, the file gets created, but Jenkins will intermittenly fail when [Cppcheck] Starting the cppcheck analysis. Usually takes a minute or two before it fails at displaying the cppcheck results. 

            Unassigned Unassigned
            lili xiangfei
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: