Ant quoted in the external mandates

  Ant users with a lot of tasks, the more valuable is that it allows users to use other developers the task of development.    Ant there on the home page in an external task list: http://ant.apache.org/external.html.    If you wish, you can quickly write its own mandate to look at the series of "Writing Custom task easy expansion Ant" on the trip. 

  <> Ant quoted in the external situation there are two tasks: 

  1.    Ant definition of optional task 

  These tasks can be said to be semi-official mandate, the mandate has actually written, but the task is mainly dependent on the resources jar document does not release together with Ant.    FTP tasks such as this is the case.    Open a document <ant install dir> \ docs \ manual \ # librarydependencies install.html, originally wanted to go to jakarta.apache.org download 1.1.0 or higher version of the commons-net and 2.0.8 or later jakarta - oro.    Note that this is against Ant1.6 said, the use of different versions of the Ant external libraries may not be the same.    To download the commons-net-1.1.0.jar put <ant install dir> \ lib directory, OK, you can use FTP: 

  <> <Ftp server = "ftp.apache.org" 
  Remotedir = "incoming" 
  Userid = "anonymous" 
  Password = "me@myorg.com" 
  Depends = "yes"> 
  <fileset Dir="htdocs/manual"/> 
  </ Ftp> <>    2.    General external mandates 

  These tasks also need to download the necessary jar file, put <ant install dir> \ lib directory, while build.xml in the need to define these external mandates.    In http://ant.apache.org/external.html Timer, there is a mandate, we can download jar after this quote 

  Build.xml: 

  <? Xml version = "1.0"> 

  <project Name="testTimer" default="test"> 

  <taskdef Name="timer" classname="de.jeckle.AntExtension.Timer"/> 

  <> <target Name="test"> 

  <timer Verbose="true"> 

  <echo> Test1 </ echo> 

  </ Timer> 

  <timer Name="timer2"> 

  <echo> Test2 </ echo> 

  <timer Name="timer3" verbose="true"> 

  <echo> Test3 </ echo> 

  </ Timer> 

  <echo> Test4 </ echo> 

  </ Timer> 

  </ Target> 

  <> </ Project> 

  Finally talk about setting the path of several approaches: 

  1.    Jar files on the Ant installation directory lib directory, Ant will be automatically loaded 

  2.    CLASSPATH environment variable settings, including the jar to use documents 

  3.    Specified in the classpath in TaskDef 

  <taskdef Name="timer" classname="de.jeckle.AntExtension.Timer" classpath="../lib/timer.jar"/> 

Bookmark it: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Google
  • DotNetKicks
  • DZone
  • Furl
  • Netvouz

Releated Articles

  • Popuklar Articles

0 Comments to “Ant quoted in the external mandates”

No Comments. Send your comment.

Leave a Reply

You must be logged in to post a comment.