ANT actual combat article (1) (2)

zhaozj2021-02-16  50

ANT actual articles (1)

Amender: Huang Kai

E_mail: hk_sz@163.com

Forehead

Since the company is now undergoing the unit test case, the evacuation understands Ant and Junit technology. The following is the collection of the director of the people (considering the summary of my idea, maybe not fully express the original author I think, I will listen out all the articles of the article or books in the reference. Everyone has time to see the original text).

If you don't understand the ANT part of the parameters, please refer to the "Ant Theory" series or Ant comes with documents.

table of Contents

First, ANT use example

1.1 Copt Task via ANT submitted the recently updated file (according to the system time) file in the current directory to the specified directory

1.2 Develop Java programs with ANT

1.3 ANT combined with JUnit for software automatic test

1.4 ANT development and deployment web applications

1.5 ANT Packaging (JAR) application

1.6 ANT development EJB application

reference

1. Develop the Java program with ANT Use ANT to use HelloWord as an Example 1> Directory Structure of this instance: D: / Test Main Directory / SRC Source Directory / Classes Compiled Class File Directory First Create Test in D Directory and SRC subdirectory. 2> Create a helloword.java file in the src subdirectory, the content is as follows: public class helloword {public static void main (string args []) {system.out.println ("Hello World!");}} 3> in Test Create a build.xml file in the main directory, as follows:

In order to improve the transplantability of the program, we separate the Property to make up the build.properties file. Build.xml file and new file build.properties follows: build.properties file: appname = HelloWordsrc = srcbuild = classesmyclasspath = $ {basedir} // $ {build} build.xml file (property section by calling file build.properties That is:

4> Run Ant in the Test directory to view the execution result. Run the Ant Run and Ant Clean to see what it will, :)

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

New Post(0)