Ant use

xiaoxiao2021-03-05  22

One: Introduction: Ant is a compilation tool for Jakarta. If you understand the Makefile under Linux / Unix, you can easily understand the use of Ant. Ant is best for you to write a Java program using UltraEdit (editplus), then you use Ant to compile, and Javadoc generates a JAR, WAR, and Copy, which can realize files can be implemented in build.xml through different TAGER, or very convenient A stylish recommendation is used. 2: Download you can download from the following address to Ant, current version: 1.41 http://jakarta.apache.org/builds/jakarta-ant/release/v1.4.1/bin/3: Installation A:) Windows 1: Unfatched the file you downloaded, there will be a Jakarta-Ant catalog generation, rename him to Ant 2: Copy Ant directory to the location you need. 3: Add: Ant_Home = Ant installation directory, Path plus $ ANT_HOME $ / in; note that you must have JDK installed, add Java_Home environment variable, and add $ JAVA_HOME $. / in; b:) Linux / UNIX 1: Unzip the file you downloaded, there will be a Jakarta-Ant catalog generation, rename him to Ant 2: Copy Ant directory to the location you need. 3: Add: Ant_Home = Ant installation directory, Path plus $ ANT_HOME $ / in; note that you must have JDK installed, add Java_Home environment variable, and add $ JAVA_HOME $. / in; Implement a modified environment variable you need to modify the .bash_profile file. The following ant_home = / usr / local / ant java_home = / usr / local / jdk path = $ PATH: $ HOME / bin: / usr / local / ant / bin: / usr / local / jdk / bin export path ant_home java_home 4: Write build.xml build.xml Makefile under Linux, which is implemented in build.xml. I give an example to explain it.

Build.xml ================================================= ==================

Value = "bingo / build / manifest.mf" /> building ... <

! - Copy Class Files to Tomcat Dir. ->

=========== -> < DELETE>

========================================== -> < Mkdir Dir = "$ {jar.dest}" />

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

New Post(0)