-
Improvement
-
Resolution: Won't Fix
-
Minor
-
None
-
Jenkins:2.332.1
Warnings Next Generation Plugin (warnings-ng): 9.11.1
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'
)