Not exactly what you asked for, but I've solved my similar problem (within Maven Antrun plugin on OS X) by using the exec task instead. So you might use, for example, something like this to replace what you have:
<exec executable="pscp"> <arg value="dirtocopy"/> <arg value="-r"/> <arg value="-i"/> <arg value="$"/> <arg value="$@$:@"/> </exec>
It's not ideal of course. For cross-platform support you'd require everyone to have an SCP implementation already installed, and you'd need conditionals to choose between scp
on *nix and pscp
or whatever on Windows.
However it has some advantages – ssh-agent
integration just works (as per your original request), and you probably don't need the -i
argument I've included for completeness.
Caveat: I haven't actually tested this with the PuTTY suite or on Windows