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

Groovy class annotations not supported

XMLWordPrintable

      When attempting to execute a pipeline that loads a library written in Groovy I receive the following exception:

      Unsupported expression for CPS transformation @ line -1, column -1
      

      The Groovy class that is referenced is a simple POGO with the class-level annotation

       @EqualsAndHashCode 

      . Removing the annotation resolves the exception for that class.

      This is a major problem with the plugin and it almost makes it unusable. For any non-trivial library it will most likely make use of Groovy language features such as class annotations. To remove the annotations would require extensive refactoring throughout the library and introduce a lot of boiler plate.

      Lack of support for Groovy class annotations is not explicitly documented (as far as I can see) either in this plugin or in the [workflow-cps-plugin](https://github.com/jenkinsci/workflow-cps-plugin).

      A workaround or solution would be very much appreciated!

            Unassigned Unassigned
            boon Joe Harte
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: