Please take a look at this line:
${server_username}:${server_password}@@{server}:/tmp
The double @@ causes problems. Instead of user:pass@server it displays as user:passserver and therefore is unable to connect to the remote ssh server.
How do you tell ant to leave the @ be?
This is my code:
<for list="${externalLibs}" param="library">
<sequential>
<for list="${servers}" param="server">
<sequential>
<echo> Copying @{library} to @{server} ${server_username}:${server_password}@@@{server}:/tmp/@{library}/${@{library}}/
</echo>
<scp todir="${server_username}:${server_password}@@@{server}:/tmp/@{library}/${@{library}}/">
<fileset dir="/tmp/@{library}/${@{library}}/" />
</scp>
</sequential>
</for>
</sequential>
</for>
In the echo command, it shows like this:
Copying LibraryName to myserver.domain.com username:password@{server}:/tmp/LibraryName/LibraryBar
It seems that it is a typo in that line - second last
@
should be changed to$
:${server_username}:${server_password}@${server}:/tmp
You escape
@
by doubling it, as in@@
.So in your case it will be:
BTW, same rule goes for
$
escape,$$
just prints a$
.In reply to OP's comment
Example:
This produces:
So, your problem is somewhere else, probably in the loop setup code