The following example is an example of executing a database query with ANT and sends an email through JavaMail. To perform the same feature, first install the following steps: 1, install J2SDK1.4.2, set PATH and ClassPath 2, install ANT161, plus Go to the PATH. 3, download javamail-1.3.1 and specify mail.jar 4 in ClassPath, download JAF-1.0.2, and specify Activation.jar 5 in ClassPath, edit the buildfile file, such as Night_Build.xml. 6. Execute: ant -buildfile night_build.xml 7, add planning tasks (using cron under Linux), you can implement Nightly Building.
night_build.xml script as follows: