稍微修改Jenkinfiles后,通过向
environment{
...
uuid = <256 char long uuid>
}
我收到错误:
7:37:34 Library piper-lib-os@v1.221.0 is cached. Copying from home.
17:37:35 org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
17:37:35 General error during class generation: Method too large: WorkflowScript.___cps___18504794 ()Lcom/cloudbees/groovy/cps/impl/CpsFunction;
17:37:35
17:37:35 groovyjarjarasm.asm.MethodTooLargeException: Method too large: WorkflowScript.___cps___18504794 ()Lcom/cloudbees/groovy/cps/impl/CpsFunction;
我已经搜索了这个问题,但没有发现任何问题,因为唯一的变化是添加了环境变量
1条答案
按热度按时间vohkndzv1#
Java的字节码大小限制为64K。这是
pipeline
块中的计数,因此,环境也包含在其中。您可能需要将管道拆分为方法,如本例所述
对于环境,您可以创建一个返回所需值的自定义方法: