• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • warnings-ng-plugin
    • None

      The documentation contained within Example.complex.jenkinsfile appears to be out-of-date and contains examples that no longer work.

       

      For example, 

      {{ def checkstyle = scanForIssues tool: [$class: 'CheckStyle'], pattern: '**/target/checkstyle-result.xml'}}

      This example produces a warning in my pipeline, using Jenkins 2.319.2, Warnings NG plugin 9.11.0:
      WARNING: Unknown parameter(s) found for class type 'io.jenkins.plugins.analysis.core.steps.ScanForIssuesStep': pattern

      As such, "pattern" is ignored, and the tool attempts to scan the console log rather than the file pattern.

       

      Please update the documentation with valid examples.

       

      In the mean time, I would appreciate it if someone could provide with with a working example in the replies with how to provide "pattern", "id", and "name" arguments using the above syntax.

      I can obviously use the code spit out by the Snippet Generator, however this does not allow me to pass a dynamic tool name.

          [JENKINS-67947] Example.complex.jenkinsfile is not up to date

          Matthew Durand created issue -

          Ulli Hafner added a comment -

          Thanks for reporting. Are these files referenced somewhere? I think I should remove them totally since everything is described in the documentation now.

          Ulli Hafner added a comment - Thanks for reporting. Are these files referenced somewhere? I think I should remove them totally since everything is described in the documentation now.

          I'm not sure if these files are referenced anywhere, I came across them by browsing the repo directly.

          For what it's worth, I did figure out a working example:

          foundIssues = scanForIssues tool: [$class: scanTool, id: scanId, name: scanName, pattern: scanPattern]

          Matthew Durand added a comment - I'm not sure if these files are referenced anywhere, I came across them by browsing the repo directly. For what it's worth, I did figure out a working example: foundIssues = scanForIssues tool: [$class: scanTool, id: scanId, name: scanName, pattern: scanPattern]

          Ulli Hafner added a comment -

          The class notation is not required anymore, all tools have a specific symbol.

          Ulli Hafner added a comment - The class notation is not required anymore, all tools have a specific symbol.

          Yes, I understand that. But is there any other way to specify a dynamic tool name?

          Matthew Durand added a comment - Yes, I understand that. But is there any other way to specify a dynamic tool name?

          Ulli Hafner added a comment -

          Ulli Hafner added a comment - This is also possible: https://github.com/jenkinsci/warnings-ng-plugin/blob/master/doc/Documentation.md#pipeline-step-with-a-generic-symbol

          Thanks! Somehow I missed that when combing through the docs before. This is perfect.

          Matthew Durand added a comment - Thanks! Somehow I missed that when combing through the docs before. This is perfect.
          Ulli Hafner made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Ulli Hafner made changes -
          Remote Link New: This issue links to "PR #1366 (Web Link)" [ 28246 ]
          Ulli Hafner made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]

            drulli Ulli Hafner
            fschwartz Matthew Durand
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: