ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From efe4it <>
Subject Re: Access denied with ant copy task
Date Fri, 29 Oct 2010 18:51:57 GMT


You did not tell much about your runtime environnement but I assume that:
1/ you are running Hudson's Container (Tomcat?) under a specific user (e.g.
hudson_user), non-admin as recommended
2/ you need access to network directory

In my opinion, this is more hudson- and system-related than ant concern.
Actually you'd better keep the build tool unaware of this access rights

Note: If target host is Linux, better use SSH copy (<sshexec> & <scp>)

The following is for connecting to a Windows share, experimented with
Tomcat6 on Win2008

I had problems using UNC paths so I decided to create network drives in the
context of hudson_user.
You can use the "net use" command to mount drive with non-default
If hudson_user is not a domain account (my case), you need to recreate a
second user on the remote machine as a regular user, say hudson_remote_user.
On the remote machine, create "hudson_remote_user/<password>" and give it
write (full?) access on your share's real location

Now you need to connect as hudson_user (modify account props to allow
opening a session via remote desktop)
Then run: net use \\REMOTE_COMP\Share /user:REMOTE_COMP\hudson_remote_user

Create a JOB to test with Hudson
My Hudson calls ANT that calls <exec> that calls a shell script that calls
"net use" to avoid having passwords displayed in Hudson output.

You may want to have Hudson recreate the drive-mapping when starting. 
In that case install the following plugin:
Doing so, whenever you restart Tomcat service, your network drive are
Have the Tomcat service start when the machine boot and your network drives
will always be ready whatever happen.



View this message in context:
Sent from the Ant - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message