Question

I am trying to make an ant build file to remote copy a war file.

Ant scp task uses a jsch library for remote copying. How do I make it work through a proxy, the jsch library clearly supports it.

does not work for jsch.

Jsch does not read environment variables like http_proxy

is there another solution ?

Was it helpful?

Solution

Juriy is right, SCP task in ant does not support HTTP_PROXY environment variable.

The http proxy can allow you to SSH using the 'HTTP CONNECT' method, an easy solution to get it working is modify the Jsch library which Ant uses for the Scp task.

src/com/jcraft/jsch/JSch.java file needs to be patches to use the http_proxy environment variable in case it is available. For use in non-login shells like from inside eclipse we need to the set the environment variables for the project from inside eclipse

I have blogged about the process here : http://xask.wordpress.com/2010/05/14/ant-scp-task-through-http_proxy/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top