小编ele*_*ent的帖子

jenkins共享库错误com.cloudbees.groovy.cps.impl.CpsCallableInvocation

我通过詹金斯管道(共享库)运行此代码。

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")
  }
}
Run Code Online (Sandbox Code Playgroud)

它在本地工作,但是在詹金斯管道中,出现此错误:

hudson.remoting.ProxyException:         
com.cloudbees.groovy.cps.impl.CpsCallableInvocation
Run Code Online (Sandbox Code Playgroud)

请帮帮我

groovy enums shared-libraries jenkins jenkins-pipeline

6
推荐指数
1
解决办法
4323
查看次数