java - Ant GET 任务和代理

标签 java windows ant proxy task

如何使用Ant's GET task有代理?

我只看到用户名和密码,但没有代理主机:(

最佳答案

gettask docs 中的关键位是:

Proxies. Since Apache Ant 1.7.0, Ant running on Java1.5 or later can use the proxy settings of the operating system if enabled with the -autoproxy option. There is also the 'setproxy' task for earlier Java versions. With proxies turned on, requests against localhost may not work as expected, if the request is relayed to the proxy.

所以你可以使用 setproxy task对于旧版本的 Ant,或查看 proxy config 上的文档:

<setproxy proxyhost="firewall" proxyport="81"/>

(get任务的用户名和密码属性用于远程系统,不适用于中间代理。)

关于java - Ant GET 任务和代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5179695/

相关文章:

java - 注释表达式的非法开头

java - 在 netbean ID 7.0RC2 中导入 net.proteanit.sql.DbUtils 包时出错

java - Hibernate删除了一条记录,但是记录并没有消失?

java - 如何解析 IPV4 和 IPV6 的数据库连接字符串

c++ - 如何将x86 DLL从WOW64进程注入(inject)到x64进程

c - setlocale 卡在 Windows 上

java - 无法在 glassfish3 上重新部署 Web 应用程序

python - 如何让 Jupyter Notebook 在系统变量中使用 PYTHONPATH 而无需直接破解 sys.path?

java - 如何在构建服务器和开发人员的机器上使用不同的属性文件集?

java - Ant 使用了错误的 java 版本