Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37125

ability to write and use groovy classes from pipeline repos / scripts

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Major Major
    • pipeline
    • None

      The `load` DSL method for Pipelines provides a nice way to load scripts and reference objects from a Pipeline script. However, it seems like it can be really useful to define simple classes in the SCM repo for a Pipeline job. E.g. just classes that represent simple data structures that you'd like to refer to in various steps of your pipelines, or Enum definitions, etc.

      Currently there does not seem to be a way to add to the classpath for the pipeline script so that an import would be able to pull in these class definitions. It would be really nice if there was a DSL method for adding to the classpath, or a way to define a property for the job that would allow you to specify additional classpath entries. It'd be totally fine for the scripting sandbox security requirements to apply to the groovy code loaded from the additional classpath entries.

            jglick Jesse Glick
            cprice404 Chris Price
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: