简体   繁体   English

詹金斯:找不到文件异常

[英]Jenkins: File not found exception

I am trying to load a file from a repository I checked out. 我正在尝试从我检出的存储库加载文件。 I am getting this error: 我收到此错误:

new File( iFilePath ) 

Err: Build failed with Error: java.io.FileNotFoundException: Y:\Jenkins\workspace\TestBuilds\Matlab\m\Contents.m (The system cannot find the path specified)

This is explained because Jenkins try to look for the file on the master. 这是因为Jenkins试图在master上查找文件。 While the file is actually located on the slave agent. 虽然该文件实际上位于从属代理上。

Any way to get around this ? 有办法解决这个问题吗?

Check out this answer: https://stackoverflow.com/a/42018578/3486967 看看这个答案: https//stackoverflow.com/a/42018578/3486967

I don't think you can use the File class on anything but the Jenkins master; 除了詹金斯大师之外,我认为你不能使用File类; try using the FilePath class 尝试使用FilePath类

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM