jenkins 用wrap([$class: 'BuildUser']) 时出现如下错误
java.lang.UnsupportedOperationException: no known implementation of class jenkins.tasks.SimpleBuildWrapper is named BuildUserat org.jenkinsci.plugins.structs.describable.DescribableModel.resolveCla...
·
java.lang.UnsupportedOperationException: no known implementation of class jenkins.tasks.SimpleBuildWrapper is named BuildUser at org.jenkinsci.plugins.structs.describable.DescribableModel.resolveClass(DescribableModel.java:449) at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:401) at org.jenkinsci.plugins.structs.describable.DescribableModel.buildArguments(DescribableModel.java:340) at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:281) at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:201) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:208) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:153) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
jenkinsfile:
env.BUILD_USER = ''
wrap([$class: 'BuildUser']) {
env.BUILD_USER = sh(returnStdout: true, script: 'echo "$BUILD_USER"').trim()
}
是因为jenkins没有安装plugin(user build vars plugin)
更多推荐
已为社区贡献4条内容
所有评论(0)