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

Declarative pipeline restricted in code size


      There is partial fix for this in pipeline-model-definition-plugin v1.4.0 and later, significantly improved in v1.8.2.  Due to the extent to which it change how pipelines are executed it is turned off by default.  It can be turned on by setting a JVM property (either on the command-line or in Jenkins script console):


      As noted, this still works best with a Jenkinsfile with pipeline directive as the only root item in the file.
      Since v1.8.2 this workaround reports an informative error for pipelines using `def` variables before the pipeline directive. Add a @Field annotation to those declaration.
      This workaround generally does NOT work if the pipeline directive inside a shared library method. If this is a scenario you want, please come join the pipeline authoring SIG and we can discuss.

      Please give it a try and provide feedback.  

      When working with a declarative pipeline script, we run into an error "Method Code too large".

      This seems to happen when the code between 'pipeline{}' is more than a specific size. 


      I'm creating this issue for this component following the suggestion of Jesse Glick at the issue 37984

      I've attached a declarative pipeline script that reproduces the issue. 



            Unassigned Unassigned
            wim Wim Gaethofs
            17 Vote for this issue
            30 Start watching this issue