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)     

 

你可能感兴趣的:(maven,c,xml,.net,ant)