Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 从Ant脚本执行play_Java_Ant_Build_Playframework_Antbuilder - Fatal编程技术网

Java 从Ant脚本执行play

Java 从Ant脚本执行play,java,ant,build,playframework,antbuilder,Java,Ant,Build,Playframework,Antbuilder,我正在寻找一种运行Ant构建脚本的方法。我已经考虑过使用这个任务,但它对我不起作用。以下是我尝试过的: <target name="deploy"> <exec executable="play"> <arg value="dist" /> </exec> </target> 我得到了这个错误: C:\Users\path\to\build.xml:39:Execute失败:java.io.

我正在寻找一种运行Ant构建脚本的方法。我已经考虑过使用这个任务,但它对我不起作用。以下是我尝试过的:

<target name="deploy">
    <exec executable="play">
        <arg value="dist" />
    </exec>    
</target>

我得到了这个错误:

C:\Users\path\to\build.xml:39:Execute失败:java.io.IOException:无法运行程序“play”:CreateProcess error=2,系统找不到指定的文件

Play已经在我的Path环境变量中,我可以通过键入
Play
从命令行执行它,所以这不是问题所在。由于系统管理员的限制,我不允许使用绝对路径


有什么想法吗?

最后手动搜索播放可执行文件并存储要在
exec
任务中使用的属性:

<exec executable="where" outputproperty="play.dir" osfamily="windows">
        <arg value="play.bat" />
</exec>
<exec executable="which" outputproperty="play.dir" osfamily="unix">
        <arg value="play" />
</exec>

<exec executable="${play.dir}" dir=" ... ">
        <arg value="dist" />
</exec>