简体   繁体   English

groovy.lang.MissingPropertyException:没有这样的属性:任何类:WorkflowScript

[英]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.

相关问题 Jenkins groovy.lang.MissingPropertyException:没有这样的属性:对于类:Script1 - Jenkins groovy.lang.MissingPropertyException: No such property: for class: Script1 groovy.lang.MissingPropertyException:没有这样的属性:Jenkins 用于 class:哈德森 - groovy.lang.MissingPropertyException: No such property: Jenkins for class: hudson groovy.lang.MissingPropertyException:没有这样的属性:类经理:Script1 - groovy.lang.MissingPropertyException: No such property: manager for class: Script1 "Jenkins groovy.lang.MissingPropertyException:没有这样的属性 Bash" - Jenkins groovy.lang.MissingPropertyException: No such property Bash groovy.lang.MissingPropertyException:没有这样的属性:类的脚本:groovy.lang.Binding - groovy.lang.MissingPropertyException: No such property: script for class: groovy.lang.Binding groovy.lang.MissingPropertyException:没有这样的属性:class 的 sh:groovy.lang.Binding - groovy.lang.MissingPropertyException: No such property: sh for class: groovy.lang.Binding 詹金斯 Android groovy.lang.MissingPropertyException: 没有这样的属性: 类的 HOME: groovy.lang.Binding - Jenkins Android groovy.lang.MissingPropertyException: No such property: HOME for class: groovy.lang.Binding groovy.lang.MissingPropertyException:否此类属性:类groovy.lang.Binding的管道 - groovy.lang.MissingPropertyException: No such property: pipeline for class: groovy.lang.Binding groovy.lang.MissingPropertyException:没有此类属性:类的节点:groovy.lang.Binding - groovy.lang.MissingPropertyException: No such property: node for class: groovy.lang.Binding groovy.lang.MissingPropertyException: 没有这样的属性: jenkins for class: groovy.lang.Binding - groovy.lang.MissingPropertyException: No such property: jenkins for class: groovy.lang.Binding
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM