ant 的 build.xml怎么手动执行?

joyajax 2008-04-05 03:16:42
ant 的 build.xml怎么手动执行,
就像在eclipse中使用菜单“run as >> ant build”一样?
...全文
790 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
qfqxml 2008-10-23
  • 打赏
  • 举报
回复
进入命令窗口 > 走到build.xml目录下 执行ant
joyajax 2008-04-06
  • 打赏
  • 举报
回复
hoho
zhx351 2008-04-05
  • 打赏
  • 举报
回复
<target name="help">
<echo message="Please specify a target![usage: ant <targetname>]" />
<echo message="Here is a list of possible target:" />
<echo message="clean ...... Delete build dir,class dir,dist dir" />
<echo message="init ...... Prepare the nesseray dir for the next work" />
<echo message="compile ...... Compile all the src files" />
<echo message="build ...... Create the war file" />
<echo message="deploy ...... Deloy the war file to web server" />
<echo message="jar ...... Create jar file of this application" />
<echo message="javadoc ...... Generates javadoc for this application"/>
</target>

<target name="clean" description="">
<delete dir="${class.home}" />
<delete dir="${build.home}" />
<delete dir="${dist.home}" />
<delete dir="${doc.home}" />
</target>

<target name="init" depends="clean" description="">
<!-- Create Time Stamp -->
<tstamp/>
<!-- Make directory for build -->
<mkdir dir="${class.home}" />
<mkdir dir="${build.home}" />
<mkdir dir="${build.home}/WEB-INF" />
<mkdir dir="${build.home}/WEB-INF/classes" />
<mkdir dir="${build.home}/WEB-INF/lib" />
<mkdir dir="${dist.home}" />
</target>

比如说想要执行clean命令,那么在命令行中可以这样写:
ant clean
zhx351 2008-04-05
  • 打赏
  • 举报
回复
<target name="help">
<echo message="Please specify a target![usage: ant <targetname>]" />
<echo message="Here is a list of possible target:" />
<echo message="clean ...... Delete build dir,class dir,dist dir" />
<echo message="init ...... Prepare the nesseray dir for the next work" />
<echo message="compile ...... Compile all the src files" />
<echo message="build ...... Create the war file" />
<echo message="deploy ...... Deloy the war file to web server" />
<echo message="jar ...... Create jar file of this application" />
<echo message="javadoc ...... Generates javadoc for this application"/>
</target>

<target name="clean" description="">
<delete dir="${class.home}" />
<delete dir="${build.home}" />
<delete dir="${dist.home}" />
<delete dir="${doc.home}" />
</target>

<target name="init" depends="clean" description="">
<!-- Create Time Stamp -->
<tstamp/>
<!-- Make directory for build -->
<mkdir dir="${class.home}" />
<mkdir dir="${build.home}" />
<mkdir dir="${build.home}/WEB-INF" />
<mkdir dir="${build.home}/WEB-INF/classes" />
<mkdir dir="${build.home}/WEB-INF/lib" />
<mkdir dir="${dist.home}" />
</target>


比如说想要执行clean命令,那么在命令行中可以这样
ant help
大河V5 2008-04-05
  • 打赏
  • 举报
回复
手动执行?安装ant,命令行里面直接ant
算不算你说的手动?
capfjian 2008-04-05
  • 打赏
  • 举报
回复
build.xml不是执行文件,是配置文件,ant才是执行文件,直接敲就是了,如需ant顺利执行,当前就得有build.xml文件

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧