title: Jenkins pipeline script fails with "General error during class generation: Method code too large!"
body: <p>When running a large Jenkins pipeline script, it can give the error:</p>
  <blockquote>
  <p>org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: General error during class generation: Method code too large!</p>
  <p>java.lang.RuntimeException: Method code too large!</p>
  </blockquote>
  <p>What is the reason for this error and how can it be fixed?</p>