Small knowledge needs to know for ant

1)    You don’t need to set variable – basedir. You can simply use it ${basedir}. And it will be the folder where build.xml resides.

 

2)    To run some target, you can pass in a variable. Like, a variable only existed and mentioned in target run, you can call it like this -- ant run -Daction=store

 

3)    A lot of open source tools supply ant related tasks, like maven and ant-contrib

There are 2 ways to integrate them into ant.

<Way 1--easy> Drop the required jar into ant’s lib directory.

<Way 2--difficult> via <typedef> declaration in build.xml. Example:

      <taskdef resource="net/sf/antcontrib/antcontrib.properties">

            <classpath>

                  <pathelement location="${ant.Contrib.location}" />

            </classpath>

</taskdef>

${ant.Contrib.location}= C:/lib/ant/ant-contrib-0.6.jar

 

4)    If you are running on a multiuser development machine, and you don't have administrative rights to put a JAR file into the ANT_HOME/lib directory, don't worry. You can put the maven-ant-tasks-2.0.8.jar file in the ~/.ant/lib directory. Ant will also automatically look for any JAR files in this directory.

 

5)    How to check additional jar files in ant lib?

      $ant -diagnostics | grep maven | grep bytes

 

6)     

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值