使用 Ant,如何在浏览器中打开文件? [英] Using Ant, how do I open a file in a browser?

查看:34
本文介绍了使用 Ant,如何在浏览器中打开文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个创建 HTML 报告的 Ant 任务.是否可以从 Ant 任务在浏览器中自动加载该报告?如果是这样,是否可以以独立于用户的方式执行此操作,还是需要使用自定义用户属性?

I have an Ant task that creates an HTML report. Is it possible to load that report automatically in a browser from the Ant task? If so, is it possible to do so in a user-independent way or would it require the use of custom user properties?

谢谢,

保罗

推荐答案

尝试使用 Ant 的 exec 任务来执行系统命令.

Try using Ant's exec task to execute a system command.

http://ant.apache.org/manual/Tasks/exec.html

来自该文档的示例:

<property name="browser" location="C:/Program Files/Internet Explorer/iexplore.exe"/>
<property name="file" location="ant/docs/manual/index.html"/>

<exec executable="${browser}" spawn="true">
    <arg value="${file}"/>
</exec>

这篇关于使用 Ant,如何在浏览器中打开文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆