Jenkinsfile DSL sourcecode Jenkinsfile DSL sourcecode jenkins jenkins

Jenkinsfile DSL sourcecode


In order to have access to the sourcecode for the Pipeline Plugin suite of plugins when working on ANY Jenkins pipeline script, whether global or otherwise, you will have to include the necessary libraries as dependencies.

I'm working on my current global pipeline library.Global Pipeline Library as IntelliJ Project and Module

Here adding the CPS library via "Project Structure" menu item:enter image description here

  1. Go to Libraries
  2. Click the add button and select "From Maven..."
  3. Type in the correct GAV (in this case com.cloudbees:groovy-cps:1.9)
  4. Click the magnifying glass button - IntelliJ will search Maven Central (and whatever other repos you've configured in the Maven IntelliJ configuration or via your settings.xml) and download them to an your local cache.

Rinse and repeat until you've got all the dependencies you need.

When you're done, it should look something like this:Groovy CPS library added to Groovy project

I found that the minimum useful were:

  • com.cloudbees:groovy-cps:1.9
  • org.jenkins-ci.plugins.workflow:workflow-api:2.+