Friday, August 15, 2014

You are not logged in, please login to comment on the article Category tray trolley All blog (130)


Project has somehow, tray trolley before beginning Ant build, we must first write Ant build file. Build file defines the build process, tray trolley Ant build files by default named build.xml, may also be other names, but when running this custom name as a parameter passed to Ant. Build files can be placed in any position, the general practice is to put the project root directory or the specified directory, so you can keep it simple and clear project. Here is a typical project hierarchy: (1) src source file storage. (2) classes to store the compiled class files. (3) lib store relies Jar package. (4) dist store packaging, released after the release package file (war, jar, etc.).
(6) web page Ant build files are stored in XML files, each file defines a unique building project (Project element); under each project can be defined many goals (target element); dependent relationship between these goals can be (depends property), when the implementation of such objectives, they need to perform depend on the goal. Each target can be defined in a number of tasks, objectives also defines the tasks to be performed in sequence. Ant build target must be called tray trolley when the task defined by Ant task definition command is actually executed. The Ant task is defined as three categories: (1) core tasks. Ant comes core mission is to tasks such as java, javc, jar and so on. (2) optional task. Optional tasks from third-party real task, requiring an additional Jar files. (3) user-defined tasks. Tasks real users to develop their own user-defined tasks.
4 start writing our build.xml file, in fact, examples of projects in Ant has a similar build file, interested can look at, here is our project build.xml file content: <xml version = "? 1.0 "encoding =" UTF-8 "> <- Project name:?! HelloAnt tray trolley default start target: run the directory: This directory -> <project name ="! HelloAnt "default =" run "> tray trolley <- source file directory -> <property name = "src" tray trolley value = "src" /> <-! after class compiler output directory -> <property tray trolley name = "dest" value = "classes" /> <-! package After the output directory -> <property name = "dist" value = "dist" /> <-! output jar file -> <property name = "hello_jar" value = "hello.jar" tray trolley /> <! - - initialize the target -> <target name = "init" depends = "clean"> <mkdir dir = "$ {dest}" /> <mkdir tray trolley dir = "$ {dist}" /> </ target> <! - - The default start target project declaration -> <target tray trolley name = "run" depends tray trolley = "jar"> <description> where you can add other actions </ description> </ target> <-! compiled class file -> < target name = "compile" depends = "init"> <javac tray trolley srcdir = "$ {src}" tray trolley destdir = "$ {dest}" includeantruntime = "true" /> </ target> <-! packaged into a jar - > <target name = "jar" depends = "compile"> <jar tray trolley destfile = "$ {dist} / $ {hello_jar}" filesetmanifest = "mergewithoutmain"> <manifest> <attribute name = "Built-By" value = " $ {user.name} "/> <attribute name =" Main-Class "value =" com.ant.hello.HelloAnt "/> <attribute name =" Class-Path "value =". "/> </ manifest > <fileset dir = "$ {dest}" /> </ jar> </ target> <-! tray trolley Clear compilation traces -> <target name = "clean"> <delete dir = "$ {dest}" / > <delete dir = "$ {dist}" /> </ target> <-! return -> <target name = "rebuild" depends = "clean, run"> <ant target tray trolley = "clean" /> < ant target = "run" /> </ target> </ project>
You are not logged in, please login to comment on the article Category tray trolley All blog (130) I know Java (53) of the first chapter (6) of Chapter II (a) Chapter IV (23) web (19) tomcat (10) java (36) j2ee (17) javaee (14) III (15) Chapter VII (19) Section 7 (4) V (8) Section (19) Project Tools (1) Chapter V (2) IV (1) Section I (a) Section VI (2) dasfdsaf (0) Hibernate (1)
Latest Comments seraph_fd: Amazing! I really still reading tray trolley less ah! get, put, post, delete the meaning and difference yangnuowei88: add up to your popularity, ha ha, boss. You write drops quite often, and I rarely good, insisted on not ... Java stack memory (Stack) lliiqiang: tray trolley But we can not use the same random synchronization session identifier and security does not simulate a theft of state ... HTTP stateless protocol tray trolley and session principle Duke 600: high-end tray trolley atmosphere on the grade! ! ! Simple and elegant CSS dialog tray trolley / message box / pop-up box tkl211: very cool, looking tray trolley forward to the landlord and slowly add other features, ha ha simple and elegant CSS dialog / message box / pop-up box


No comments:

Post a Comment