copy in ANT throws java.io.FileNotFoundException

别来无恙 提交于 2019-12-11 07:49:47

问题


I am using ANT task Copy to copy a zip file from one share to another

<copy file="\\server_share\nightly\xyz08022012.zip" todir="Z:\output\Nightly"/>

when this gets executed, I am getting the below exception

Failed to copy \server_share\nightly\xyz08022012.zip to Z:\output\Nightly\xyz08022012.zip due to java.io.FileNotFoundException Z:\output\Nightly\xyz08022012.zip (The system cannot find the path specified.)`

When I change the Z:\output\Nightly to C:\temp, the copy works

Z:\ points to a server share which is mounted on the server with different user credentials and the drive is made persistent. This work around is because of the fact that when the build runs, the build user does not have access to the output share

Hence I mapped the server share as a network drive with different credentials (the user who has read/write permission) and made this drive persistent

This is on a Windows 7 machine where the build is running.

I tried doing a copy manually and that worked

I looked into Ant Copy Task: Failed to copy due to java.io.FileNotFoundException but doesn't help me

来源:https://stackoverflow.com/questions/9194364/copy-in-ant-throws-java-io-filenotfoundexception

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!