[英]groovy.lang.MissingPropertyException: No such property: any for class: WorkflowScript
I Have created multibranch pipeline(declarative) and placed jenkinsfile in bitbucket repo.我创建了多分支管道(声明性)并将 jenkinsfile 放在 bitbucket repo 中。 hooks configured to trigger build in pipeline.钩子配置为触发管道中的构建。 when developer commits code pipeline it's throwing following error.当开发人员提交代码管道时,它会抛出以下错误。
[Bitbucket] Build result notified groovy.lang.MissingPropertyException: No such property: any for class: WorkflowScript at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:458) at org.kohsuke.groovy.sandbox.impl.Checker$6.call(Checker.java:293) [Bitbucket] 构建结果通知groovy.lang.MissingPropertyException: No such property: any for class: WorkflowScript at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter .getProperty(ScriptBytecodeAdapter.java:458) 在 org.kohsuke.groovy.sandbox.impl.Checker$6.call(Checker.java:293)
When I checked the build groovy.lang.MissingPropertyException: No such property: any for class: WorkflowScript error occurred.当我检查构建groovy.lang.MissingPropertyException: No such property: any for class: WorkflowScript发生错误。 when I tried to build the job in replay mode I have notified red space in the beginning of the pipeline script.当我尝试以重放模式构建作业时,我已在管道脚本的开头通知了红色空间。 I have removed the red space and it worked.我已经删除了红色空间并且它起作用了。
jenkinsfile view in "reply" mode “回复”模式下的 jenkinsfile 视图
Jenkinsfile in bitbucket bitbucket 中的 Jenkinsfile
the pipeline structure I used is我使用的管道结构是
pipeline {
agent any
options {....}
stages {...}
}
please help me how to eradicate the issue...请帮助我如何根除这个问题...
The groovy.lang.MissingPropertyException
error usually means that Jenkins is not able to find a variable or command used. groovy.lang.MissingPropertyException
错误通常意味着 Jenkins 无法找到使用的变量或命令。
In this case, the error message says No such property: **any** for class: WorkflowScript
.在这种情况下,错误消息显示No such property: **any** for class: WorkflowScript
。
Therefore, it looks like Jenkins is not able to find any
.因此,看起来 Jenkins 无法找到any
.
I believe in a declarative pipeline, agent any
is valid.我相信声明式管道, agent any
是有效的。 Are you using any
in another place in the script?您是否在脚本的其他地方使用any
?
You did not provide the full script, so I could not see where the problem is.你没有提供完整的脚本,所以我看不出问题出在哪里。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.