You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by efe4it <ef...@gmail.com> on 2010/10/29 20:51:57 UTC

Re: Access denied with ant copy task

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


Re: Access denied with ant copy task

Posted by efe4it <ef...@gmail.com>.
Hi Paul

Glad to be of some help.

In addition, note that if you have installed JBoss as a service, and used
LocalSystem as owner, the JBoss process will not be granted any remote
access.
The LocalSystem account is defined as such by Windows. That's why you have
to run Hudson's Container under a specific account.


Regards



-- 
View this message in context: http://ant.1045680.n5.nabble.com/Access-denied-with-ant-copy-task-tp3242026p3243937.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