【发布时间】:2018-07-14 15:29:52
【问题描述】:
我通过 jenkins 管道(共享库)运行此代码。
enum Components {
service('name_api')
Components(String componentName) {
this.componentName = componentName
}
private String componentName
String getComponentName() {
return componentName
}
static boolean isValid(String name) {
for (Components component : values()) {
if (component.getComponentName().equalsIgnoreCase(name)) {
return true
}
}
println("The name of component is incorrect")
}
}
它在本地工作,但在 Jenkins 管道中,我收到此错误:
hudson.remoting.ProxyException:
com.cloudbees.groovy.cps.impl.CpsCallableInvocation
请帮帮我
【问题讨论】:
-
你能提供minimal reproducible example吗?您粘贴了一个枚举,它没有说明您运行的共享库文件是什么以及什么也很重要 - 您如何运行它(您正在执行什么方法等)
-
问题已解决。问题出在我的构造函数中
标签: jenkins groovy enums shared-libraries jenkins-pipeline