使用Ant,我怎么打开浏览器中的文件? [英] Using Ant, how do I open a file in a browser?

查看:167
本文介绍了使用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.

<一个href=\"http://ant.apache.org/manual/Tasks/exec.html\">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天全站免登陆