我想使用ANT将文件从本地计算机移动到映射的驱动器。我使用net use命令将Z驱动器映射到以下位置
我首先尝试使Z驱动器成为我的目录。
<copy todir="Z:/Results/">
<fileset dir="${LocalResults}">
<include name="**/*"/>
</fileset>
</copy>
这是詹金斯的输出
[copy] Copying 16 files to Z:\Results
Attempt to copy C:\Program Files\results\index.html to Z:\Results\index.html using NIO Channels failed due to 'failed to create the parent directory for Z:\Results\index.html'. Falling back to streams.
BUILD FAILED
C:\Deploy\copyResults.xml:69: Failed to copy C:\Program Files\results\index.html to Z:\Results\index.html due to java.io.FileNotFoundException Z:\Results\index.html(The system cannot find the path specified)
如果我使用该位置而不是映射的驱动器,那么它将起作用。
<copy todir="//IP Address/C$/ShareFolder/Results/">
<fileset dir="${LocalResults}">
<include name="**/*"/>
</fileset>
</copy>
是否有理由在todir中使用映射的驱动器不起作用?
快速开始的问题,詹金斯(Jenkins)是否在具有服务的Windows服务器上运行?
在这种情况下,我认为您无法使用映射驱动器(由于服务帐户)。
最好使用文件夹URL:\\ MY_IP \ share \ drive
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句