This works great most of the time — I connect to the dev VM via a windows share using an SMB connection from my Mac, so the Ant scripts point to the remote box as /Volumes/D$. Unfortunately…
…my router is flaky and times out my cable connection about 2-3 times a day, rendering my connection to my dev VM non-existent. Here is where the slight problem occurs – the mount-point on the Windows box is D$, so when OSX makes an SMB connection, it creates a D$ temporary folder in the /Volumes directory on the Mac. When the connection is unexpectedly broken, the clean-up to remove that directory fails, and when the share is reconnected, OSX creates a new version of the directory, as “D$-1″ (or -2, -3, etc.), which breaks the Ant scripts.
The solution, simply, is to open the Terminal after such an unexpected disconnect, and perform the command:
sudo rmdir /Volumes/D$
to remove the unmounted directory.
I have tried to connect directly to the smb share in the terminal utilizing the specific share directory:
sudo mount_smbfs -W workgroupname //username@ipaddressofserver/D$ /Volumes/D$
but unfortunately, you have to su in the terminal (switch to root user) in order to access the contents — otherwise the directory is read only. When running the Ant scripts from Eclipse, you don’t have root user permissions, and copying to the remote machine fails. Anyone have any thoughts on this?