运行UNIX命令ant脚本 - build.xml文件 [英] Run UNIX command in ant script - build.xml

查看:177
本文介绍了运行UNIX命令ant脚本 - build.xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在ant脚本把这个UNIX命令?

 罐子-xvf test.ear out.war |罐子-x;光盘目录;罐子-xvf ../out.war

将这项工作?

 <目标名称=unear>
    <回声> ***在解压缩*** LT; /回声>
    < EXEC可执行=罐子outputproperty =noOfFiles>
         < ARG值= - xvf命令/>
         < ARG值=test.ear out.war/>
         < ARG值=| />
         < ARG值=罐子/>
         < ARG值= - X/>
         < ARG值=; />
         < ARG值=光盘目录/>
         < ARG值=; />
         < ARG值=罐子/>
         < ARG值= - xvf命令/>
         < ARG值=../ out.war/>
    < / EXEC>
< /目标与GT;


解决方案

战争,耳朵和罐子只是ZIP文件。您可以使用解压任务来破解它打开。
你需要在你的榜样成多个任务,打破了unix命令。

How to put this unix command in ant script?

jar -xvf test.ear out.war | jar -x ; cd directory ; jar -xvf ../out.war

Will this work?

<target name="unear">
    <echo>***Un-tarring***</echo>
    <exec executable="jar" outputproperty="noOfFiles">
         <arg value="-xvf" />
         <arg value="test.ear out.war" />
         <arg value="|" />
         <arg value="jar" />
         <arg value="-x" />
         <arg value=";" />
         <arg value="cd directory" />
         <arg value=";" />
         <arg value="jar" />
         <arg value="-xvf" />
         <arg value="../out.war" />
    </exec>
</target>

解决方案

wars, ears and jars are simply zip files. you can use the unzip task to crack it open. You'll need to break up the unix command in your example into multiple tasks.

这篇关于运行UNIX命令ant脚本 - build.xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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