-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Hi Team,
I'm working on integrating the Checkmarx AST Scanner into our Jenkins pipeline using a shared library written in Groovy.
Currently, I am able to invoke the checkmarxASTScanner step directly inside a Jenkinsfile, and it works as expected.
Working example inside Jenkinsfile:
Issue:
When trying to use the checkmarxASTScanner step inside a shared library Groovy method (for example under vars/ or src/), I am unable to import or invoke it properly.
Example that does not work:
The above fails to execute, and I understand it may be because checkmarxASTScanner is a Jenkins pipeline step that needs a Script context.
What I'm Trying to Achieve:
I would like to wrap the checkmarxASTScanner invocation in a reusable shared library method, so I can call it with custom parameters across multiple pipelines, like this:
checkmarxHelper.runScan(this, scanParams)
Questions:
What is the recommended way to invoke checkmarxASTScanner from a shared library?
Is there an API or wrapper class exposed by com.checkmarx.jenkins.CheckmarxScanBuilder that can be used programmatically within a shared library?
Can you provide a working example or best practice for this use case?
Thanks in advance for your help!

