来自自定义 Jenkins 插件的步骤必须用主体调用
Step from custom Jenkins plugin throwing step must be called with a body
我开发了一个自定义 Jenkins 插件,它为我的管道提供了一个步骤“mystep”。
合并 this PR 后,我的步骤失败并出现此错误:
java.lang.IllegalStateException: mystep step must be called with a body
我的步骤不需要主体:mystep param1: "somevalue"
。它是通过扩展 Step
实现的
class MyStepStep @DataBoundConstructor constructor(private val param1: String) : Step() {
@set:DataBoundSetter
var param1: String? = null
@Throws(Exception::class)
override fun start(context: StepContext): StepExecution {
我如何表明它不需要正文以使其不会失败?
问题是 StepDescriptor
实现覆盖了值 takesImplicitBlockArgument
设置 true。返回 false,一切又开始工作了:
abstract class MyStepDescriptor : StepDescriptor() {
override fun takesImplicitBlockArgument(): Boolean {
return false
}
我开发了一个自定义 Jenkins 插件,它为我的管道提供了一个步骤“mystep”。
合并 this PR 后,我的步骤失败并出现此错误:
java.lang.IllegalStateException: mystep step must be called with a body
我的步骤不需要主体:mystep param1: "somevalue"
。它是通过扩展 Step
class MyStepStep @DataBoundConstructor constructor(private val param1: String) : Step() {
@set:DataBoundSetter
var param1: String? = null
@Throws(Exception::class)
override fun start(context: StepContext): StepExecution {
我如何表明它不需要正文以使其不会失败?
问题是 StepDescriptor
实现覆盖了值 takesImplicitBlockArgument
设置 true。返回 false,一切又开始工作了:
abstract class MyStepDescriptor : StepDescriptor() {
override fun takesImplicitBlockArgument(): Boolean {
return false
}