Ant is a series of tasks that are greatly batched under the Java platform, which can automatically complete compilation, test, packaging, deployment, etc.
Ant is a very great batch command executor under the Java platform, which is very convenient to automatically complete compilation, test, packaging, deployment, etc., greatly improve development efficiency. If you haven't started using Ant yet, then you will start learning to use, so that your development level is a new level.
Ant has been integrated in Eclipse, we can run Ant directly in Eclipse.
Step1:
Create a build.xml and placed in the root directory. Build.xml defines the batch command to be executed. Although Ant can also use other file names, compliance can be more standardized and easy to communicate with others.
Typically, the SRC stores the Java source file, Classes stores compiled Class files, lib stores all JAR files for compilation and running, Web stores JSP, etc., DISS is stored, the packaged JAR file, and the DOC stores the API document.
Then create a build.xml file in the root directory, enter the following:
The red font in the text indicates that the default task is replaced according to the specific situation.
The green font representing green fonts with personal platforms or packages are replaced to your platform.
STEP2:
Go to Project Properthentic-> Builders
Default has a Java Builder, add an ANTBUILDER
STEP3
Click on Window -> Show View -> Ant, which appears in the ANT window, you can add multiple build files to the inside (according to different needs), then click the Run Button that click on the window.
Note To set the Default Out Folder under the project propertys in Eclipse to generate $ {dir.class} generated in Ant, so that you will not report the class path when running the program under Eclipse. Wrong
The above only provides an audience over Ant, please refer to Apaceh Ant Manual-CHM for details.