Cannot pass parserId to analysisParser

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      When attempting to use a pipeline step with a generic symbol (as documented in `Documentation.md`, it is not possible to pass `parserId`, in the use-case when using a custom parser (eg: groovyScript parser).

       

      It would allow for much more streamlined pipeline code if it were possible to pass `parserId` to `analysisParser`.

      Example of non-working scripted pipeline code:

      scanForIssues tool: analysisParser(
          analysisModelId: 'groovy',
          id: 'my-id',
          name: 'Custom issues',
          pattern: '*.log',
          parserId: 'custom-parser'
      )

      Output from above code:

      WARNING: Unknown parameter(s) found for class type 'io.jenkins.plugins.analysis.warnings.RegisteredParser': parserId
      java.lang.IllegalArgumentException: Could not instantiate {tool=@analysisParser(analysisModelId=groovy,id=my-id,name='Custom issues',pattern=.log,parserId=custom-parser)} for io.jenkins.plugins.analysis.core.steps.ScanForIssuesStep: java.lang.IllegalArgumentException: Could not instantiate {analysisModelId=groovy, id=my-id, name='Custom issues', pattern=.log, parserId=custom-parser} for io.jenkins.plugins.analysis.warnings.RegisteredParser: java.lang.reflect.InvocationTargetException
       

      Working code:

      scanForIssues tool: groovyScript(
          id: 'my-id',
          name: 'Custom issues',
          pattern: '*.log',
          parserId: 'custom-parser'
      )

            Assignee:
            Ulli Hafner
            Reporter:
            Matthew Durand
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: