【发布时间】:2015-06-07 17:27:09
【问题描述】:
我想使用 ANT 将文件从本地机器移动到映射驱动器。我使用 net use 命令将我的 Z 驱动器映射到以下位置
- //IP地址/C$/ShareFolder
- net use Z: /persistent:yes //IP地址/C$/ShareFolder
我首先尝试让 Z 驱动器成为我的目标。
<copy todir="Z:/Results/">
<fileset dir="${LocalResults}">
<include name="**/*"/>
</fileset>
</copy>
这是 Jenkins 的输出
[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 中使用映射驱动器不起作用?
【问题讨论】: