[英]groovy.lang.MissingMethodException: No signature of method: in groovy on jenkins buildflow
[英]groovy.lang.MissingMethodException: No signature of method: Why is this error coming for Jenkins Shared Pipeline library?
我有一個共享管道庫 代碼。 該庫在我的 Jenkins 中隱式加載,我在我的 Jenkinsfile 中使用以下代碼調用其中一種方法:
node {
CheckOut {}
}
我也試過使用CheckOut.call()
& CheckOut.call([:],{})
但無濟於事。 不斷收到以下錯誤:
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: CheckOut.call() is applicable for argument types: (org.jenkinsci.plugins.workflow.cps.CpsClosure2) values: [org.jenkinsci.plugins.workflow.cps.CpsClosure2@668faf1f]
Possible solutions: call(), wait(), any(), wait(long), main([Ljava.lang.String;), any(groovy.lang.Closure)
PS - 該錯誤並非特定於一個函數,庫的所有其他函數也會發生該錯誤。
發現問題。 在Jenkins全局配置中配置共享庫repo時,鏈接最后不要填寫.git。
例如,使用https://github.com/arghyadeep-k/jenkins-shared-library而不是https://github.com/arghyadeep-k/jenkins-shared-library.git 。
然后,調用 Jenkinsfile 中的函數作為
node{
checkOut.call()
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.