Method Code Too Large Error

Hi all,

Today, I encountered " Method Code Too Large Error" and I read this page.

I have fully followed the “Resolution” on this page. However, since this error still appears. So, it has become difficult to add new blocks such as stage to Jenkinsfile.

I also checked that there is a way to dynamically generate elements such as stage as shown on this page.

However, there are many jobs in my Jenkinsfile, and many of the parts are “when” for branch selection and “environment”, and the percentage of job execution like “step” is small.

Is there any workaround for this case? For example, with a feature like Server Side Include, is it possible to expose part of the pipeline section and load it dynamically?