我原来这样写:
<exec dir="${another.project}" executable="ant">
</exec>
结果:Execute failed: java.io.IOException: CreateProcess: ant error=2
后来把 executable="ant" 改成 executable="ant.bat" 就成功了
官方文档这样说:
Windows Users
The <exec>
task delegates to Runtime.exec
which in turn apparently calls ::CreateProcess
. It is the latter Win32 function that defines the exact semantics of the call. In particular, if you do not put a file extension on the executable, only ".EXE" files are looked for, not ".COM", ".CMD" or other file types listed in the environment variable PATHEXT. That is only used by the shell.
Note that .bat files cannot in general by executed directly. One normally needs to execute the command shell executable cmd
using the /c
switch.
<target name="help"> <exec executable="cmd"> <arg value="/c"/> <arg value="ant.bat"/> <arg value="-p"/> </exec> </target>
相关推荐
ant的配置文件ant的配置文件ant的配置文件ant的配置文件
ANT使用指南ANT使用指南ANT使用指南ANT使用指南ANT使用指南ANT使用指南ANT使用指南ANT使用指南ANT使用指南
NULL 博文链接:https://yuxiaoshui.iteye.com/blog/1250355
ant 使用入门ant 使用入门ant 使用入门ant 使用入门
jmeter+ant 持续集成build.xml文件,直接使用ant命令执行jmeter脚本文件,得到图形测试报告
ant打包时编码 GBK 的不可映射字符 原因:这个主要是因为我们在写代码的时候加入了一些中文注释,而导致编译时候出现的问题。 解决方式:要处理这个问题,仅仅只需要在 build.xml文件中的调用javac的所有地方加入...
直接使用flex的sdk生成swc文件,很繁琐,而且对于大项目来说,是个头痛的事情。ant在对java打包生成jar时,它优良的设计显露无疑,这里我们使用它,来生成swc,完成项目编译打包。
ANT文件详解 ant介绍 ANT 命令
这是一个ANT自编译的程序,可以在myeclipse下创建ant文件,根据代码配置,下载后直接可以用。
这是一套蚂蚁设计(Antdesign)组件的sketch文档,可用于设计和产品原型
ant安装文件包括windows版本和linux版本,另外有ant使用模板配置文件
ant ant ant antant ant ant antant ant ant ant
使用Ant构建批量压缩js、css文件脚本
NULL 博文链接:https://zhousheng193.iteye.com/blog/1196431
Ant 配置文件详解 Ant 各种详细配置应有尽有!!!
ant工具使用指南ant工具使用指南ant工具使用指南
ant 配置文件集合
非maven项目中的ANT打包可执行JAR包脚本,包括配置文件、第三方jar打包
ant执行 target 前先判断文件是否存在,只有文件存在才执行。
ant的build文件