Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Jenkins管道-在尝试加载外部groovy文件时,没有这样的文件或目录_Java_Jenkins_Groovy - Fatal编程技术网

Java Jenkins管道-在尝试加载外部groovy文件时,没有这样的文件或目录

Java Jenkins管道-在尝试加载外部groovy文件时,没有这样的文件或目录,java,jenkins,groovy,Java,Jenkins,Groovy,我有一个Jenkin文件,看起来像: node { def rootDir = pwd() def externalMethod = load("${rootDir}/ci/jenkins/shops.groovy") // Call the method we defined in externalMethod. externalMethod.lookAtThis("Simon") } 另一个文件位于ci/jenkins/shops.groovy def lookAtThis(Str

我有一个Jenkin文件,看起来像:

node {

def rootDir = pwd()

def externalMethod = load("${rootDir}/ci/jenkins/shops.groovy")

// Call the method we defined in externalMethod.
externalMethod.lookAtThis("Simon")

}
另一个文件位于ci/jenkins/shops.groovy

def lookAtThis(String whoAreYou) {
    echo "Look at this, ${whoAreYou}! You loaded this from another file!"
}
但詹金斯正在返回错误

java.io.IOException:java.io.FileNotFoundException:/root/workspace/lush global soa architecture/develope/ci/jenkins/shops.groovy(没有这样的文件或目录)


我不确定它为什么找不到这个文件。

我让它工作,结果我需要先签出scm,然后才能加载文件

checkout scm

也许这是unix权限问题。运行脚本的用户是否具有对shops.groovy的读取权限?我还尝试了def externalMethod=load(${rootDir}@script/ci/jenkins/shops.groovy”)@luc14n0我不确定,工作人员从Github中下载了文件。我可以试着设置文件权限并向上推。是的,一定要试试。我以前也遇到过类似的问题。运气不好@luc14n0,我更改了文件权限,但仍然得到“找不到文件”