Quote External tasks in Ant

zhaozj2021-02-16  89

ANT provides users with a lot of tasks, more valuable, which allows users to use other developers to develop tasks. There is an external task list on the Ant home page: http: //ant.apache.org/external.html. As long as you like, you can also write a self-study of your own task, look at the "write custom task, easy to expand Ant".

There are two cases: There are two cases referenced in Ant:

First, an option task defined by Ant

These tasks can be said to be a semi-official task, and the task is actually written, but the resource dependent on the task is mainly the JAR file is not released with Ant. For example, an FTP task is this. Open the document /DOCS/Manual/install.html#libraryDependencies, you have to download 1.1.0 or later Commons-Net and 2.0.8 or later Jakarta- Jakarta- Jakarta- Oro. Note that this is for Ant1.6, and the external libraries used by different Ant versions may be different. Put the downloaded commons-net-1.1.0.jar in the / Lib Directory, OK, you can use FTP now:

RemoteDir = "incoming"

Userid = "anonymous"

Password = "me@myorg.com"

Depends = "yes"

>

Second, the general external task

These tasks also need to download the required JAR files, put them in the / Lib directory, and these external tasks are required in Build.xml. There is a Timer Task on http://ant.apache.org/external.html, we can reference this after downloading JAR

Build.xml:

Test1

test2

test3

TEST4

Finally, a few ways to set the type path:

1. Place the JAR file in the lib directory of the Ant installation directory, Ant will automatically load

2. Set the environment variable ClassPath, contain the JAR file 3 to reference. Specify ClassPath in TaskDef

转载请注明原文地址:https://www.9cbs.com/read-14227.html

New Post(0)