簡體   English   中英

groovy.lang.MissingMethodException:沒有方法簽名:為什么 Jenkins 共享管道庫會出現此錯誤?

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

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM