通过代理执行 ant scp 任务

发布于 2024-09-01 01:21:47 字数 174 浏览 1 评论 0原文

我正在尝试制作一个 ant 构建文件来远程复制 war 文件。

Ant scp 任务使用 jsch 库进行远程复制。 我如何让它通过代理工作,jsch库显然支持它。

不适用于 jsch。

Jsch 不读取像 http_proxy 这样的环境变量

还有其他解决方案吗?

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 ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

残花月 2024-09-08 01:21:47

Juriy是对的,ant中的SCP任务不支持HTTP_PROXY环境变量。

http 代理可以允许您使用“HTTP CONNECT”方法进行 SSH,使其工作的一个简单解决方案是修改 Ant 用于 Scp 任务的 Jsch 库。

src/com/jcraft/jsch/JSch.java 文件需要修补才能使用 http_proxy 环境变量(如果可用)。
为了在非登录 shell 中使用,比如在 eclipse 内部,我们需要从 eclipse 内部设置项目的环境变量,

我已经在博客中介绍了该过程:
http://xask.wordpress.com/2010/ 05/14/ant-scp-task-through-http_proxy/

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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文