`General error during class generation: Method code too large!`
AdvancedTroubleshootingJenkinsfile syntax, Groovy & CPS errors
Answer
Likely causes → The declarative pipeline compiles to a method exceeding 64 KB of bytecode: too many stages, huge matrix, long inline scripts.
Diagnose → Count stages and inline script length; recent large additions are the trigger.
Fix → Move inline shell to files, extract stages into library steps, enable SCRIPT_SPLITTING_TRANSFORMATION=true system property, split into multiple jobs.
Prevent → Keep Jenkinsfiles short by policy (template plus parameters).
More on Jenkinsfile syntax, Groovy & CPS errors
`WorkflowScript: 1: Missing required section "agent" @ line 1, column 1.`Beginner`Unknown stage section "step". Starting with version 0.5, steps in a stage must be in a ‘steps’ block.`Beginner`java.lang.NoSuchMethodError: No such DSL method 'withSonarQubeEnv' found among steps [archive, bat, build, ...]`Beginner`java.io.NotSerializableException: java.util.regex.Matcher`Advanced`java.io.NotSerializableException: groovy.json.internal.LazyMap`Intermediate`org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object`Intermediate