且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

运行UNIX命令ant脚本 - build.xml文件

更新时间:2022-10-22 19:16:06

战争,耳朵和罐子只是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.