ant-user mailing list archives

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

Hi,

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
issues 

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
credentials
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
<password>

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:
http://wiki.hudson-ci.org/display/HUDSON/Startup+Trigger
Doing so, whenever you restart Tomcat service, your network drive are
recreated
Have the Tomcat service start when the machine boot and your network drives
will always be ready whatever happen.

HTH

Emmanuel

-- 
View this message in context: http://ant.1045680.n5.nabble.com/Access-denied-with-ant-copy-task-tp3242026p3242614.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message