首页 > 解决方案 > 从 HTTP GET 请求的响应中设置 ANT 属性

问题描述

我是 ANT 新手,我需要一种将 HTTP GET 请求的输出读入属性的方法,以便稍后在构建脚本中使用它。

我尝试使用https://ant.apache.org/manual/Tasks/get.html但发现没有可用的参数。我正在使用 ant 1.9.6 和最新的 ant contrib 版本

谢谢!

标签: javahttppropertiesantget

解决方案


<loadresource>任务与嵌套的<url>资源一起使用:

<loadresource property="content">
    <url url="https://google.com"/>
</loadresource>

推荐阅读