<java classname="cn.wenping.cagf.hbm2dao.CodeGenerator" fork="true" failοnerrοr="true" >
<classpath refid="ant.run.lib.path"></classpath>
<sysproperty key="file.encoding" value="UTF-8"/>
<arg line="--rootpath=${rootpath}"/>
<arg line="--outputpath=${src}"/>
<arg line="${hibernate.mappings}"/>
<classpath refid="ant.run.lib.path"></classpath>
<sysproperty key="file.encoding" value="UTF-8"/>
<arg line="--rootpath=${rootpath}"/>
<arg line="--outputpath=${src}"/>
<arg line="${hibernate.mappings}"/>
</java>
在这里给main方法传过去的参数用<arg line>而不是用<arg value>,查阅参考文档发现有如下几句
Examples
<arg value="-l -a"/>
is a single command-line argument containing a space character.这里表示只有一个参数
<arg line="-l -a"/>
represents two separate command-line arguments.这里用空格分开表示的是两个独立的参数
<arg path="/dir;/dir2:\dir3"/>
is a single command-line argument with the value \dir;\dir2;\dir3
on DOS-based systems and /dir:/dir2:/dir3
on Unix-like systems.